From cb5dbfe6067f068c7e27b166e7adf1c785e9dee0 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 16 May 2023 14:22:48 +0200 Subject: [PATCH] powershell: escape variable with curly brackets This fixes an issue with program names that include a dot, in our case `podman.exe`. This was caused by the change in commit 6ba7ebbc. Fixes #1853 Signed-off-by: Paul Holzinger --- powershell_completions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powershell_completions.go b/powershell_completions.go index 177d2755f2..99e98ccf53 100644 --- a/powershell_completions.go +++ b/powershell_completions.go @@ -47,7 +47,7 @@ filter __%[1]s_escapeStringWithSpecialChars { `+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+` } -[scriptblock]$__%[2]sCompleterBlock = { +[scriptblock]${__%[2]sCompleterBlock} = { param( $WordToComplete, $CommandAst, @@ -279,7 +279,7 @@ filter __%[1]s_escapeStringWithSpecialChars { } } -Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock $__%[2]sCompleterBlock +Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock ${__%[2]sCompleterBlock} `, name, nameForVar, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))