Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for PowerShell Desktop 5.x #50

Open
andyfeller opened this issue Mar 23, 2024 · 1 comment
Open

Provide support for PowerShell Desktop 5.x #50

andyfeller opened this issue Mar 23, 2024 · 1 comment

Comments

@andyfeller
Copy link
Contributor

Overview

This is a follow up to #38 regarding extending the gh copilot alias support for PowerShell to include PowerShell Desktop. As explained by @xt0rted below, the current design of the ghcs function takes advantage of features not backwards compatible with PowerShell 5.x:

Could you elaborate on why you might need that?

@andyfeller by using the clean block the aliases require powershell core 7.3+. Any version older than that, including the original windows only version, will give an error about missing closing }.

At C:\Users\brian\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:89 char:15
+ function ghcs {
+               ~
Missing closing '}' in statement block or type definition.
At C:\Users\brian\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:145 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
At C:\Users\brian\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:147 char:15
+ function ghce {
+               ~
Missing closing '}' in statement block or type definition.
At C:\Users\brian\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:169 char:1
+ }

+ ~

Unexpected token '}' in expression or statement.

    + CategoryInfo          : ParserError: (:) [], ParseException

    + FullyQualifiedErrorId : MissingEndCurlyBrace

powershell.exe is the old version and is 5.1 on my machine, while pwsh.exe is the newer cross platform version.

Originally posted by @xt0rted in #38

@Pokeylooted
Copy link

It may be helpful adding that this is only supported by powershell 7+, as by default terminal in windows 11 uses powershell 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants