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

[BUG]: alias #68

Open
lanceyliao opened this issue Apr 16, 2024 · 3 comments
Open

[BUG]: alias #68

lanceyliao opened this issue Apr 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@lanceyliao
Copy link

lanceyliao commented Apr 16, 2024

Thanks for taking the time to fill out this out! 🙇
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>
@lanceyliao lanceyliao added bug Something isn't working needs-triage needs to be reviewed labels Apr 16, 2024
@mxie
Copy link

mxie commented Apr 30, 2024

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!

@mxie mxie removed the needs-triage needs to be reviewed label Apr 30, 2024
@lanceyliao
Copy link
Author

Thanks for the reply, it didn't work.

@ericbrunner
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants