Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upClarify how to use the PowerShell completions #695
Comments
|
I got the following to work: gh completion --shell powershell |Out-File -FilePath gh.completion.ps1 -Encoding utf8
./gh.completion.ps1or gh completion --shell powershell |Out-String |Invoke-Expression |
|
@dougbu I tried running |
|
@JanPokorny the completions themselves are seemingly incomplete. If I type W.r.t. your profile, I found the command didn't work because profiles aren't sourced. Needed the following in my profile: New-Item function::global:Complete-gh -value { gh completion --shell powershell | Out-String | Invoke-Expression } >$nullI then execute |
|
in my
and I get the expected result in a new powershell window. Agreed, though, I expected |
|
Ah, great. Thanks @bc3tech |
Describe the feature or problem you’d like to solve
The page https://cli.github.com/manual/gh_completion explains to use the completions by adding
eval "$(gh completion)"to a profile file.For PowerShell, the equivalent command is
gh completion -s powershell | iex, which produces the following error:Proposed solution
Explain how to use the PowerShell completions