diff --git a/Tests/Engine/ModuleHelp.Tests.ps1 b/Tests/Engine/ModuleHelp.Tests.ps1 index 21188e019..b164784ca 100644 --- a/Tests/Engine/ModuleHelp.Tests.ps1 +++ b/Tests/Engine/ModuleHelp.Tests.ps1 @@ -229,20 +229,14 @@ Describe 'Cmdlet parameter help' { 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 = $parameterHelp.pipelineInput -eq 'True' -or $parameterHelp.pipelineInput -match 'ByPropertyName' $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" - } + $parameterHelpPipelineInput = $parameterHelp.pipelineInput -match 'ByValue' + $parameterHelpPipelineInput | Should -Be $parameterAttribute.ValueFromPipeline ` + -Because "Parameter $parameterName of command $CommandName and parameter set $($parameterAttribute.ParameterSetName) has correct ValueFromPipeline attribute" } } diff --git a/docs/Cmdlets/Invoke-Formatter.md b/docs/Cmdlets/Invoke-Formatter.md index c3f724803..ca7548f74 100644 --- a/docs/Cmdlets/Invoke-Formatter.md +++ b/docs/Cmdlets/Invoke-Formatter.md @@ -16,9 +16,9 @@ Formats script text or a file based on the input settings or default settings. ``` Invoke-Formatter [-ScriptDefinition] [[-Settings] ] [[-Range] ] - [] + [-WhatIf] [-Confirm] [] Invoke-Formatter -Path [[-Settings] ] [[-Range] ] - [] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -168,6 +168,41 @@ Accept pipeline input: True Accept wildcard characters: False ``` +### -Confirm + +Prompts you for confirmation before writing changes to a file specified by **Path**. This parameter +has no effect when **ScriptDefinition** is used. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows which files specified by **Path** would be changed without writing them. Formatting still +runs and the formatted text is returned. This parameter has no effect when **ScriptDefinition** is +used. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,