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

Issue with Powershell x86 and Start-SshAgent #29

Open
akorczynskikcura opened this issue Oct 6, 2021 · 1 comment
Open

Issue with Powershell x86 and Start-SshAgent #29

akorczynskikcura opened this issue Oct 6, 2021 · 1 comment

Comments

@akorczynskikcura
Copy link

akorczynskikcura commented Oct 6, 2021

System Details

  • posh-sshell version/path: 0.3.1 ~\Documents\WindowsPowerShell\Modules\posh-sshell\0.3.1
  • PowerShell version: 5.1.18362.1714
  • OS: Microsoft Windows NT 10.0.18363.0
  • posh-git version: 1.0.0

Issue Description

I am experiencing a problem with Powershell x86 window (no issues on x64)

Here is my powershell config:

Import-Module posh-git
Import-Module posh-sshell
Start-SshAgent

Output from Powershell x64

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

Starting ssh agent service.
Keys have already been added to the ssh agent.
Loading personal and system profiles took 6344ms.

Output from Powershell x86

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

Get-Command : The term 'ssh.exe' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\[USER]\Documents\WindowsPowerShell\Modules\posh-sshell\0.3.1\src\Win32-OpenSSH.ps1:7 char:30
+         $executableMatches = Get-Command ssh.exe | ForEach-Object Fil ...
+                              ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ssh.exe:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'ssh.exe' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\[USER]\Documents\WindowsPowerShell\Modules\posh-sshell\0.3.1\src\Win32-OpenSSH.ps1:7 char:30
+         $executableMatches = Get-Command ssh.exe | ForEach-Object Fil ...
+                              ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ssh.exe:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'ssh.exe' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\[USER]\Documents\WindowsPowerShell\Modules\posh-sshell\0.3.1\src\Win32-OpenSSH.ps1:7 char:30
+         $executableMatches = Get-Command ssh.exe | ForEach-Object Fil ...
+                              ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ssh.exe:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'ssh.exe' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\[USER]\Documents\WindowsPowerShell\Modules\posh-sshell\0.3.1\src\Win32-OpenSSH.ps1:7 char:30
+         $executableMatches = Get-Command ssh.exe | ForEach-Object Fil ...
+                              ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ssh.exe:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Enter passphrase for /c/Users/[USER]/.ssh/id_rsa:
@JeremySkinner
Copy link
Collaborator

I don't use Windows anymore so I'm not able to check this but IIRC the native version of OpenSSH that ships with Windows is only x64, so it makes sense that the executable can't be found within x86 powershell.

I believe that the fix in #17 should should suppress the error output though so it'll silently continue, so I'd suggest trying checking out the source and using that rather than using the build on PS gallery (which I don't think has been updated since 2018)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants