Closed shehrozeee closed 7 months ago
@shehrozeee : thank you for opening the issue and my apologies for the confusion!
I believe you're running into the problem described in #38 as the current PowerShell is 7.4+ and you are using PowerShell Desktop 5.x. There are workarounds described in #38 from other users while this is brought up for prioritization.
I'm going to close this as a duplicate of #50 for now.
What happened?
installed gh copilot cli and wanted to setup alias, used the $GH_COPILOT_PROFILE = Join-Path -Path $(Split-Path -Path $PROFILE -Parent) -ChildPath "gh-copilot.ps1" gh copilot alias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force ) echo ". $GH_COPILOT_PROFILE" >> $PROFILE to setup alias as mentioned on the readme.
The alias is not configured and I now get an error when I open a new powershell
I have checked the brackets in the gh-copilot.ps1 and they seem to be fine according to vs code syntax highlighting at least.
just to check, I copied the functions from the file and pasted them in powershell manually, it stops parsing before the last } and throws the same error
Versions
PS C:\Users\Shehroze> gh version gh version 2.46.0 (2024-03-20) https://github.com/cli/cli/releases/tag/v2.46.0
Relevant terminal output
PS C:\Users\Shehroze> function ghcs {
PS C:\Users\Shehroze> } At line:1 char:1
on opening a new powershell->
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
At C:\Users\Shehroze\OneDrive\Documents\WindowsPowerShell\gh-copilot.ps1:8 char:15
PS C:\Users\Shehroze>