Better PoSH: Using $PSDefaultParameterValues

Today’s quick PoSH tip comes from a conversation I had with Kevin Crouch (@PsychoData) and Brett Miller (@BrettMiller_IT), and I got to learn about the $PSDefaultParameterValues variable, which I’d never used before.

Essentially, $PSDefaultParameterValue allows you to define ahead of your functions how certain parameters should be answered. A great use case is when using Active Directly cmdlets to ensure that multiple calls to Domain Controllers always use the same one. Instead of a drawn out explanation about how it’s used, I think a few lines of code will draw a better picture.

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.