From 21c6f23e9ed0816835b7332676b264ab09b391d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 23:11:32 +0000 Subject: [PATCH 1/3] Document formatter confirmation parameters Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com> --- docs/Cmdlets/Invoke-Formatter.md | 36 ++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/docs/Cmdlets/Invoke-Formatter.md b/docs/Cmdlets/Invoke-Formatter.md index c3f724803..26c04fa43 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,38 @@ Accept pipeline input: True Accept wildcard characters: False ``` +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```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 what would happen if the cmdlet runs. The cmdlet isn't run. + +```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, From d7380e4499e27fd90773a9638e3a493ffdf3e3fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 23:50:04 +0000 Subject: [PATCH 2/3] Handle pipeline binding help values in tests Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com> --- Tests/Engine/ModuleHelp.Tests.ps1 | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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" } } From f75c252dd43a8561a69dd326b9ceae981a3f1af1 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 23 Oct 2026 00:56:54 +0100 Subject: [PATCH 3/3] Clarify -Confirm and -WhatIf parameter descriptions Updated descriptions for -Confirm and -WhatIf parameters to clarify their effects when using the Path and ScriptDefinition options. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/Cmdlets/Invoke-Formatter.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/Cmdlets/Invoke-Formatter.md b/docs/Cmdlets/Invoke-Formatter.md index 26c04fa43..ca7548f74 100644 --- a/docs/Cmdlets/Invoke-Formatter.md +++ b/docs/Cmdlets/Invoke-Formatter.md @@ -170,7 +170,8 @@ Accept wildcard characters: False ### -Confirm -Prompts you for confirmation before running the cmdlet. +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 @@ -186,7 +187,9 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet isn't run. +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