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]: Could not find file gh-copilot.ps1 #72

Open
fredgohsman opened this issue May 3, 2024 · 0 comments
Open

[BUG]: Could not find file gh-copilot.ps1 #72

fredgohsman opened this issue May 3, 2024 · 0 comments
Labels
bug Something isn't working needs-triage needs to be reviewed

Comments

@fredgohsman
Copy link

What happened?

Installed the github/gh-copilot extension on Windows in Terminal (PowerShell).
gh copilot extension and suggest commands work fine
When I run the commands to enable aliases, it is unable to find the gh-copilot.ps1 file.

Alias PowerShell commands:

$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

Versions

gh version 2.49.0 (2024-04-30)
gh copilot version 1.0.2 (2024-04-26)

Relevant terminal output

New-Item : Could not find file 'C:\Users\...\OneDrive\Documents\WindowsPowerShell\gh-copilot.ps1'.
At line:1 char:39
+ ... lias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force )
+                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\...\O...\gh-copilot.ps1:String) [New-Item], FileNotFoundException
    + FullyQualifiedErrorId : NewItemIOError,Microsoft.PowerShell.Commands.NewItemCommand

Out-File : Cannot bind argument to parameter 'FilePath' because it is null.
At line:1 char:37
+ ... lias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force )
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Out-File], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.OutFileComm
   and
@fredgohsman fredgohsman added bug Something isn't working needs-triage needs to be reviewed labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

1 participant