File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,28 @@ Function Test-PSBoundParameters {
1818 )
1919
2020 # Display all the passed parameters:
21+ " Display all the passed parameters:"
2122 $PSBoundParameters
2223
2324 # or with a switch statement:
25+ " or with a switch statement:"
2426 switch ($PSBoundParameters.Keys ) {
2527 ' Text' { write-output ' A value for Text was supplied' }
2628 ' Number' { write-output ' A value for Number was supplied' }
2729 }
2830
2931 # or looping through all the key/value pairs
32+ " or looping through all the key/value pairs"
3033 foreach ($boundparam in $PSBoundParameters.GetEnumerator ()) {
3134 " Key={0} Value={1}" -f $boundparam.Key , $boundparam.Value
3235 }
3336
34- # or Call a second function passing all the parameters plus any extra if needed:
35- # Test-PSBoundParametersPriv @PSBoundParameters -ExtraDemoParam 'Testing 123'
37+
38+ " Testing removing"
39+ $splat = [hashtable ]::new()
40+ foreach ( $items in $PSBoundParameters.GetEnumerator () ) {
41+ $Splat [$item.Key ] = $item.Value }
42+ $splat.Remove (" Text" )
43+ $splat
44+
3645}
You can’t perform that action at this time.
0 commit comments