Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Provide support for PowerShell Desktop 5.x #50

@andyfeller

Description

@andyfeller

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions