Skip to content

Commit

Permalink
Force ForEach-Object to return array in pwsh completion
Browse files Browse the repository at this point in the history
Fixes #1847

Merge spf13/cobra#1850
  • Loading branch information
hoshsadiq committed Jan 2, 2023
1 parent f58362c commit 584b42e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/completion.pwsh.gotmpl
Expand Up @@ -97,7 +97,7 @@ Register-ArgumentCompleter -CommandName '{{ .CMDVarName }}' -ScriptBlock {
}
$Longest = 0
$Values = $Out | ForEach-Object {
[Array]$Values = $Out | ForEach-Object {
#Split the output in name and description
$Name, $Description = $_.Split("`t",2)
__{{ .CMDVarName }}_debug "Name: $Name Description: $Description"
Expand Down

0 comments on commit 584b42e

Please sign in to comment.