Skip to content

Commit 7fe8e7e

Browse files
committed
Updating to ignore common parameters
1 parent 8efb0fa commit 7fe8e7e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

AutoRuns.psm1

+4-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,10 @@ Begin {
461461
)
462462
Begin {
463463
## Add 'All' if nothing else was supplied
464-
if(($PSBoundParameters.Keys | ? { $_ -notin "ShowFileHash","VerifyDigitalSignature" }).Count -eq 0)
464+
$parametersToIgnore = ("ShowFileHash","VerifyDigitalSignature") +
465+
[System.Management.Automation.PSCmdlet]::CommonParameters +
466+
[System.Management.Automation.PSCmdlet]::OptionalCommonParameters
467+
if(($PSBoundParameters.Keys | ? { $_ -notin $parametersToIgnore }).Count -eq 0)
465468
{
466469
$All = [switch]::Present
467470
}

0 commit comments

Comments
 (0)