Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(complete): Update PowerShell dynamic completion script
PowerShell does not support inline syntax for assigning environment variables, so we must instead set the value before running the completer and restore it after it exits. The completer will often, if not always, be surrounded by double quotes. To avoid syntax errors, define the argument to Invoke-Expression as a here-string so the quotes are part of the expression. Updates the instructions for adding the argument completer to the profile. Piping a native command to Invoke-Expression invokes each line separately. Adding `Out-String` to the pipeline ensures that Invoke-Expression receives the whole script as a single value from the pipeline. Fixes: #5847
- Loading branch information