From af8f0626ac892906d4b351492d8ea52f76f25b3a Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Thu, 27 Nov 2025 21:50:17 +0200 Subject: [PATCH 1/2] Update PowerShell completions for compatibility with PowerShell v5.1 Modified the PowerShell completion script to replace the null-coalescing operator (`??` - a v7 feature) with a conditional statement compatible with PowerShell v5.1. The script now uses an if-else check for null descriptions in the language completion section. --- assets/completions/_bat.ps1.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/completions/_bat.ps1.in b/assets/completions/_bat.ps1.in index 7061b9db..a9b3bcd5 100644 --- a/assets/completions/_bat.ps1.in +++ b/assets/completions/_bat.ps1.in @@ -49,7 +49,10 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script } '*;--language' { Get-MyLanguages | - ForEach-Object {[CompletionResult]::new(($_.MyParameter -replace "^(.*)$", '''$1'''), $_.MyParameter, [CompletionResultType]::ParameterName, $_.MyDescription ?? '_no value_')} + ForEach-Object { + $desc = if ($null -eq $_.MyDescription) { '_no value_' } else { $_.MyDescription } + [CompletionResult]::new(($_.MyParameter -replace "^(.*)$", '''$1'''), $_.MyParameter, [CompletionResultType]::ParameterName, $desc) + } break } '*;--theme' { From 1ee1d8fdff9618cbd9cc2499b50006e5e2be52fb Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Thu, 27 Nov 2025 21:57:47 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a22109d1..24b0e636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ ## Other - Improve README documentation on pager options passed to less, see #3443 (@injust) - +- Make PowerShell completions compatible with PowerShell v5.1, see #3495 (@keith-hall) - Use more robust approach to escaping in Bash completions, see #3448 (@akinomyoga) ## Syntaxes