Skip to content

Commit e1b8a43

Browse files
committed
Refreshing
1 parent 81c7ca4 commit e1b8a43

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

TestingModule/Functions/Test-PSBoundParameters.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)