{"id":1451,"date":"2025-04-16T18:00:30","date_gmt":"2025-04-16T18:00:30","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=1451"},"modified":"2025-04-16T18:00:30","modified_gmt":"2025-04-16T18:00:30","slug":"github-copilot-for-cli-for-powershell","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=1451","title":{"rendered":"GitHub Copilot for CLI for PowerShell"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"\">&#13;<br \/>\n            &#13;<\/p>\n<p>GitHub Subsequent has this cool challenge that&#8217;s principally Copilot for the CLI (command line interface). You&#8217;ll be able to join their waitlist on the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/githubnext.com\/projects\/copilot-cli\/\">Copilot for CLI website<\/a>.<\/p>\n<blockquote>\n<p>Copilot for CLI offers three shell instructions: <code>??<\/code>, <code>git?<\/code> and <code>gh?<\/code><\/p>\n<\/blockquote>\n<p>That is cool and all, however I take advantage of PowerShell. Seems these ?? instructions are simply router instructions to a bigger EXE known as github-copilot-cli. So when you go &#8220;?? one thing&#8221; you are actually going &#8220;github-copilot-cli what-the-shell one thing.&#8221;<\/p>\n<p>So this implies I ought to be capable of to do the identical\/comparable aliases for my PowerShell immediate AND change the injected immediate (have a look at me I am a immediate engineer) so as to add &#8216;use powershell to.&#8217; <\/p>\n<p>Now it isn&#8217;t good, however hopefully it would make the purpose to the Copilot CLI staff that PowerShell wants love additionally.<\/p>\n<p>Listed below are my aliases. Be at liberty to recommend if these suck. Observe the addition of &#8220;consumer powershell to&#8221; 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. Numerous prospects.<\/p>\n<pre class=\"brush: ps; gutter: false; toolbar: false; collapse: false; smart-tabs: false;\">operate ?? { <br\/>$TmpFile = New-TemporaryFile <br\/>github-copilot-cli what-the-shell ('use powershell to ' + $args) --shellout $TmpFile <br\/>if ([System.IO.File]::Exists($TmpFile)) { <br\/>$TmpFileContents = Get-Content material $TmpFile <br\/>if ($TmpFileContents -ne $nill) {<br\/>Invoke-Expression $TmpFileContents <br\/>Take away-Merchandise $TmpFile <br\/>}<br\/>}<br\/>}<p>operate git? {<br\/>$TmpFile = New-TemporaryFile<br\/>github-copilot-cli git-assist $args --shellout $TmpFile<br\/>if ([System.IO.File]::Exists($TmpFile)) {<br\/>$TmpFileContents = Get-Content material $TmpFile <br\/>if ($TmpFileContents -ne $nill) {<br\/>Invoke-Expression $TmpFileContents <br\/>Take away-Merchandise $TmpFile <br\/>}<br\/>}<br\/>}<br\/>operate gh? {<br\/>$TmpFile = New-TemporaryFile<br\/>github-copilot-cli gh-assist $args --shellout $TmpFile<br\/>if ([System.IO.File]::Exists($TmpFile)) {<br\/>$TmpFileContents = Get-Content material $TmpFile <br\/>if ($TmpFileContents -ne $nill) {<br\/>Invoke-Expression $TmpFileContents <br\/>Take away-Merchandise $TmpFile <br\/>}<br\/>}<br\/>} <\/p><\/pre>\n<p>It additionally then gives to run the command. Very easy.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"margin: 0px; display: inline\" alt=\"image\" src=\"https:\/\/images.hanselman.com\/blog\/Windows-Live-Writer\/GitHub-Copilot-for-CLI-for-PowerShell_B0E3\/image_f39afdbf-04bf-4c95-a913-2404f46dc308.png\" width=\"999\" height=\"437\"\/><\/figure>\n<p>Hope you prefer it. Numerous enjoyable stuff taking place on this area.<\/p>\n<p>&#13;<br \/>\n&#13;<br \/>\n&#13;<br \/>\n&#13;<\/p>\n<div class=\"about-scott\">\n<div class=\"bioBox\">\n<h4>About Scott<\/h4>\n<div class=\"bioBoxInner\">\n<p>Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, guide, father, diabetic, and Microsoft worker. He&#8217;s a failed stand-up comedian, a cornrower, and a e book creator.<\/p>\n<p>                        <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/facebook.com\/shanselman\" class=\"sm-link\"><img decoding=\"async\" src=\"http:\/\/images.hanselman.com\/main\/icon-fb.png\" alt=\"facebook\"\/><\/a><br \/>\n                        <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/bsky.app\/profile\/scott.hanselman.com\" class=\"sm-link\"><img decoding=\"async\" src=\"http:\/\/images.hanselman.com\/main\/icon-bluesky.png\" alt=\"bluesky\"\/><\/a><br \/>\n                        <a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/feeds.hanselman.com\/ScottHanselman\" class=\"sm-link\"><img decoding=\"async\" src=\"http:\/\/images.hanselman.com\/main\/icon-rss.png\" alt=\"subscribe\"\/><\/a><br \/>\n                        <a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/hanselman.com\/about\">About<\/a> \u00a0 <a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/www.hanselman.com\/newsletter\">Publication<\/a>\n                    <\/div><\/div>\n<div class=\"ads-box\">\n<div class=\"ad-item\">\n                        <strong>Internet hosting By<\/strong><br \/>\n                        <a rel=\"nofollow\" target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/azure.microsoft.com\/free\"><img loading=\"lazy\" decoding=\"async\" alt=\"Hosted on Linux using .NET in an Azure App Service\" class=\"ad\" border=\"0\" valign=\"top\" vspace=\"4\" width=\"125\" height=\"125\" src=\"http:\/\/images.hanselman.com\/main\/azure-250x250.png\"\/><\/a>\n                    <\/div><\/div><\/div>\n<p>&#13;<br \/>\n&#13;<br \/>\n            &#13;<br \/>\n&#13;<br \/>\n&#13;<br \/>\n            &#13;<br \/>\n&#13;<br \/>\n            &#13;\n        <\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>&#13; &#13; GitHub Subsequent has this cool challenge that&#8217;s principally Copilot for the CLI (command line interface). You&#8217;ll be able to join their waitlist on the Copilot for CLI website. Copilot for CLI offers three shell instructions: ??, git? and gh? That is cool and all, however I take advantage of PowerShell. Seems these ?? [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1453,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[1355,934,933,1356],"class_list":["post-1451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-cli","tag-copilot","tag-github","tag-powershell"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/1451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1451"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/1451\/revisions"}],"predecessor-version":[{"id":1452,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/1451\/revisions\/1452"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/1453"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69d9690a190636c2e0989534. Config Timestamp: 2026-04-10 21:18:02 UTC, Cached Timestamp: 2026-05-06 18:02:01 UTC -->