|
13 | 13 |
|
14 | 14 | þ{
|
15 | 15 | $lines = @()
|
16 |
| - $commonParameters = 'Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable' |
| 16 | + $commonParameters = 'Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable', 'Confirm', 'WhatIf' |
17 | 17 | foreach ($parameter in ((Get-Command $Parameters.Name).Parameters.Values | Where-Object Name -NotIn $commonParameters))
|
18 | 18 | {
|
19 | 19 | $lines += " It 'Should habe the expected parameter $($parameter.Name)' {"
|
20 |
| - $lines += " `$parameter = (Get-Command $($Parameters.Name)).Parameters[$($parameter.Name)]" |
| 20 | + $lines += " `$parameter = (Get-Command $($Parameters.Name)).Parameters['$($parameter.Name)']" |
21 | 21 | $lines += " `$parameter.Name | Should -Be '$($parameter.Name)'"
|
22 | 22 | $lines += " `$parameter.ParameterType.ToString() | Should -Be $($parameter.ParameterType.ToString())"
|
23 | 23 | $lines += " `$parameter.IsDynamic | Should -Be `$$($parameter.IsDynamic)"
|
|
38 | 38 | }
|
39 | 39 |
|
40 | 40 | þ{
|
41 |
| - $commonParameters = 'Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable' |
| 41 | + $commonParameters = 'Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable', 'Confirm', 'WhatIf' |
42 | 42 | foreach ($parameterSet in (Get-Command $Parameters.Name).ParameterSets)
|
43 | 43 | {
|
44 | 44 | $name = $parameterSet.Name
|
|
0 commit comments