Skip to content

Commit 8474860

Browse files
Update FilterOutCommonParams function
Use PSCmdlet Types to get common and optional parameters. Signed-off-by: Gilbert Sanchez <[email protected]>
1 parent 0edda3e commit 8474860

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/Help.tests.ps1

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
BeforeDiscovery {
44
function global:FilterOutCommonParams {
55
param ($Params)
6-
$commonParams = @(
7-
'Debug', 'ErrorAction', 'ErrorVariable', 'InformationAction', 'InformationVariable',
8-
'OutBuffer', 'OutVariable', 'PipelineVariable', 'Verbose', 'WarningAction',
9-
'WarningVariable', 'Confirm', 'Whatif'
10-
)
6+
$commonParams = [System.Management.Automation.PSCmdlet]::OptionalCommonParameters +
7+
[System.Management.Automation.PSCmdlet]::CommonParameters
118
$params | Where-Object { $_.Name -notin $commonParams } | Sort-Object -Property Name -Unique
129
}
1310

0 commit comments

Comments
 (0)