dahlbyk/posh-sshell

Issue with Powershell x86 and Start-SshAgent

akorczynskikcura opened this issue · 1 comments

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:

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)