July 2018
Beginner
552 pages
13h 18m
English
Another cool automatic variable, PSBoundParameters, gives you access to all parameters that were bound in your cmdlet or function. Do you remember the variable $args from before? This is $args on steroids. With it being a dictionary, we can access all bound parameters by their name; manipulate, add, and remove keys; and use this variable for splatting, as you can see in the following code sample:
# Another cool dictionary to usefunction Get-AllTheThings{ [CmdletBinding()] param ( $Parameter1, $Parameter2 ) $PSBoundParameters | Out-Host Get-AllTheInternalThings @PSBoundParameters}function Get-AllTheInternalThings{ [CmdletBinding()] param ( $Parameter1, $Parameter2 ) Write-Verbose -Message 'Pretty cool, eh?' Write-Host "Parameter1 ...Read now
Unlock full access