[BUG]: alias
Thanks for taking the time to fill out this out! :bow: By submitting this issue, you agree to follow our Code of Conduct.
What happened?
What did you do? What happened? What did you expect to happen?
$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
At this point the alias doesn't take effect, and opening a new powershell window results in a bug
Versions
1.0.1
Relevant terminal output
Please copy and paste any relevant terminal output. Please check your output before submission to ensure sensitive information is redacted.
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
尝试新的跨平台 PowerShell https://aka.ms/pscore6
所在位置 C:\Users\admin\Documents\WindowsPowerShell\gh-copilot.ps1:1 字符: 15
+ function ghcs {
+ ~
语句块或类型定义中缺少右“}”。
所在位置 C:\Users\admin\Documents\WindowsPowerShell\gh-copilot.ps1:57 字符: 1
+ }
+ ~
表达式或语句中包含意外的标记“}”。
所在位置 C:\Users\admin\Documents\WindowsPowerShell\gh-copilot.ps1:59 字符: 15
+ function ghce {
+ ~
语句块或类型定义中缺少右“}”。
所在位置 C:\Users\admin\Documents\WindowsPowerShell\gh-copilot.ps1:81 字符: 1
+ }
+ ~
表达式或语句中包含意外的标记“}”。
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : MissingEndCurlyBrace
加载个人及系统配置文件用了 700 毫秒。
(base) PS C:\Windows\system32>
Thanks for your report! We've pushed an update to our docs for the PowerShell setup. Please try running the following instead:
$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
Let me know if this fixes anything!
Thanks for the reply, it didn't work.
@mxie I still get that issue. How to mitigate it?
At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:1 char:15
- function ghcs {
~Missing closing '}' in statement block or type definition. At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:63 char:1
- }
- ~ Unexpected token '}' in expression or statement. At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:65 char:15
- function ghce {
~Missing closing '}' in statement block or type definition. At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:94 char:1
- }
- ~ Unexpected token '}' in expression or statement.
- CategoryInfo : ParserError: (:) [], ParseException
- FullyQualifiedErrorId : MissingEndCurlyBrace
At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:1 char:15
- function ghcs {
~Missing closing '}' in statement block or type definition. At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:63 char:1
- }
- ~ Unexpected token '}' in expression or statement. At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:65 char:15
- function ghce {
~Missing closing '}' in statement block or type definition. At C:\Users\ErichJS\Documents\WindowsPowerShell\gh-copilot.ps1:94 char:1
- }
- ~ Unexpected token '}' in expression or statement.
- CategoryInfo : ParserError: (:) [], ParseException
- FullyQualifiedErrorId : MissingEndCurlyBrace
clean -> end