diff --git a/Tests/Engine/ModuleHelp.Tests.ps1 b/Tests/Engine/ModuleHelp.Tests.ps1 index 39ff83f2b..e2dbea8c4 100644 --- a/Tests/Engine/ModuleHelp.Tests.ps1 +++ b/Tests/Engine/ModuleHelp.Tests.ps1 @@ -234,6 +234,25 @@ Describe 'Cmdlet parameter help' { # To avoid calling Trim method on a null object. $helpType = if ($parameterHelp.parameterValue) { $parameterHelp.parameterValue.Trim() } $helpType | Should -Be $codeType -Because "help for $commandName has correct parameter type for $parameterName" + + foreach($parameterAttribute in $parameter.Attributes) { + if ($parameterAttribute.ValueFromPipeline -eq $null) { continue } + + $parameterHelpPipelineInput = if ($parameterHelp.pipelineInput -eq 'True (ByPropertyName, ByValue)') { + $true + } + else { + [System.Boolean]::Parse($parameterHelp.pipelineInput) + } + + $parameterHelpPipelineInput | Should -Be $parameterAttribute.ValueFromPipelineByPropertyName ` + -Because "Parameter $parameterName of command $CommandName and parameter set $($parameterAttribute.ParameterSetName) has correct ValueFromPipelineByPropertyName attribute" + + if ($parameterHelp.pipelineInput -eq 'True (ByPropertyName, ByValue)') { + $parameterAttribute.ValueFromPipeline | Should -BeTrue ` + -Because "Parameter $parameterName of command $CommandName and parameter set $($parameterAttribute.ParameterSetName) has correct ValueFromPipeline attribute" + } + } } foreach ($helpParam in $HelpParameterNames) { diff --git a/docs/Cmdlets/Invoke-Formatter.md b/docs/Cmdlets/Invoke-Formatter.md index e88f5f2c8..6e4b3a642 100644 --- a/docs/Cmdlets/Invoke-Formatter.md +++ b/docs/Cmdlets/Invoke-Formatter.md @@ -104,7 +104,7 @@ Aliases: Required: False Position: 3 Default value: None -Accept pipeline input: False +Accept pipeline input: True Accept wildcard characters: False ``` @@ -121,7 +121,7 @@ Aliases: Required: True Position: 1 Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` @@ -137,7 +137,7 @@ Aliases: Required: False Position: 2 Default value: CodeFormatting -Accept pipeline input: False +Accept pipeline input: True Accept wildcard characters: False ```