GitHub Subsequent has this cool venture that’s principally Copilot for the CLI (command line interface). You may join their waitlist on the Copilot for CLI website.
Copilot for CLI offers three shell instructions:
??
,git?
andgh?
That is cool and all, however I take advantage of PowerShell. Seems these ?? instructions are simply router instructions to a bigger EXE referred to as github-copilot-cli. So for those who go “?? one thing” you are actually going “github-copilot-cli what-the-shell one thing.”
So this implies I ought to have the ability to to do the identical/comparable aliases for my PowerShell immediate AND change the injected immediate (take a look at me I am a immediate engineer) so as to add ‘use powershell to.’
Now it isn’t good, however hopefully it should make the purpose to the Copilot CLI workforce that PowerShell wants love additionally.
Listed below are my aliases. Be happy to recommend if these suck. Observe the addition of “person powershell to” for the ?? one. I could make a ?? and a p? the place one does bash and one does PowerShell. I may even have it use wsl.exe and shell out to bash. Plenty of prospects.
operate ?? {
$TmpFile = New-TemporaryFile
github-copilot-cli what-the-shell ('use powershell to ' + $args) --shellout $TmpFile
if ([System.IO.File]::Exists($TmpFile)) {
$TmpFileContents = Get-Content material $TmpFile
if ($TmpFileContents -ne $nill) {
Invoke-Expression $TmpFileContents
Take away-Merchandise $TmpFile
}
}
}operate git? {
$TmpFile = New-TemporaryFile
github-copilot-cli git-assist $args --shellout $TmpFile
if ([System.IO.File]::Exists($TmpFile)) {
$TmpFileContents = Get-Content material $TmpFile
if ($TmpFileContents -ne $nill) {
Invoke-Expression $TmpFileContents
Take away-Merchandise $TmpFile
}
}
}
operate gh? {
$TmpFile = New-TemporaryFile
github-copilot-cli gh-assist $args --shellout $TmpFile
if ([System.IO.File]::Exists($TmpFile)) {
$TmpFileContents = Get-Content material $TmpFile
if ($TmpFileContents -ne $nill) {
Invoke-Expression $TmpFileContents
Take away-Merchandise $TmpFile
}
}
}
It additionally then gives to run the command. Very easy.

Hope you prefer it. Plenty of enjoyable stuff taking place on this house.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, advisor, father, diabetic, and Microsoft worker. He’s a failed stand-up comedian, a cornrower, and a e book writer.