diff --git a/Types/CommandInfo/CouldPipe.ps1 b/Types/CommandInfo/CouldPipe.ps1 index f0b440229..49589a697 100644 --- a/Types/CommandInfo/CouldPipe.ps1 +++ b/Types/CommandInfo/CouldPipe.ps1 @@ -1,6 +1,13 @@ param([PSObject]$InputObject) -:nextParameterSet foreach ($paramSet in $this.ParameterSets) { +$parameterSets = + if ($this.ResolvedCommand.ParameterSets) { + $this.ResolvedCommand.ParameterSets + } elseif ($this.ParameterSets) { + $this.ParameterSets + } + +:nextParameterSet foreach ($paramSet in $parameterSets) { if ($ParameterSetName -and $paramSet.Name -ne $ParameterSetName) { continue } $params = @{} $mappedParams = [Ordered]@{} # Create a collection of mapped parameters diff --git a/Types/CommandInfo/CouldPipeType.ps1 b/Types/CommandInfo/CouldPipeType.ps1 index 5de226540..eb470d129 100644 --- a/Types/CommandInfo/CouldPipeType.ps1 +++ b/Types/CommandInfo/CouldPipeType.ps1 @@ -3,7 +3,14 @@ param( $Type ) -:nextParameterSet foreach ($paramSet in $this.ParameterSets) { +$parameterSets = + if ($this.ResolvedCommand.ParameterSets) { + $this.ResolvedCommand.ParameterSets + } elseif ($this.ParameterSets) { + $this.ParameterSets + } + +:nextParameterSet foreach ($paramSet in $parameterSets) { if ($ParameterSetName -and $paramSet.Name -ne $ParameterSetName) { continue } $params = @{} $mappedParams = [Ordered]@{} # Create a collection of mapped parameters