Summary: Use Pester to safely test script changes to Active Directory.
How can I test my Active Directory script without having it make changes to my live domain?
Use Pester’s mocking feature to test your code without using the actual Active Directory cmdlets.
Huh? How do you test what the cmdlet will do without the cmdlet..?
Talk about an article that’s light on details. Not even a github link let alone a demo!
https://github.com/pester/Pester
The PowerTip posts are always short; they’re paired with the longer blog post that gets published earlier the same day. This particular one is associated with this article:
http://blogs.technet.com/b/heyscriptingguy/archive/2015/12/16/unit-testing-powershell-code-with-pester.aspx
To answer your question, Tim, you aren’t testing what the cmdlet would do. Rather, you’re testing the logic in your own code in such a way that you don’t need to set up an AD environment first, which would take more time (and money for compute time on VMs,
etc.) If your code passes this unit test first, then you move on to the more expensive and more thorough tests.
@Dave
This "association" is not a good idea. How is anyone supposed to discover this association without training?