I updated Windows 10 from 1709 to 1803 and now when I run powershell, this message displays:
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at askpass.Program.Main(String[] args)
@Angeldude What scoop command did you run?
None, this is coming from pshazz. If I uninstall pshazz, the message never displays. This only displays on startup of powershell.
update: I get the error if I type pshazz init
Maybe related: https://github.com/lukesampson/pshazz/issues/24
I dunno if the windows update changed something about where askpass searches the windows path but it was working fine in version 1709.
I use 1803, it works fine.
After doing a huge deep dive into the system, reading through the pshazz scripts and the askpass source code, I eventually started searching for issues with openssh. It was then that I discovered that windows 10 has an OpenSSH folder in its System32 folder, which I've never noticed before.
Running scoop which ssh would print the path to that directory instead of the openssh I had installed via scoop. I renamed the OpenSSH folder in the System32 directory and now they don't conflict anymore and the issue is resolved. However, I learned that _that_ OpenSSH directory was supposedly also in Win10 1709 so it's strange that the conflict showed up now.
Oh, did you install another openssh? I just use the built-in openssh in Windows 10.
Yeah, since I didn't know windows 10 came with it. I'd try using it now but I can't figure out how to get it to work without that error.
@Angeldude and @h404bi I only have scoop SSH installed and I'm getting this issue too. Here is the path in use:
位 scoop which ssh
C:\ProgramData\scoop\apps\win32-openssh\current\ssh.exe
SSH was installed via sudo scoop install 7zip git win32-openssh --global.
@TCB13 Do you use Windows 10? If yes, please try to uninstall the openssh you installed with scoop, restart the terminal, and just use the built-in openssh that located at C:\WINDOWS\System32\OpenSSH\ssh.exe, to see if the issue is gone.
@h404bi I do use Windows 10 and I would like to keep my current OpenSSH version because of key compatibility issues. Apparently Windows 10 OpenSSH client only has a very small subset of features :(
Regardless of which SSH I'm using, or whether I uninstall all SSH packages from Scoop and use the one in Win 10, I get this Unhandled Exception as well but only when trying to log in to certain servers. With others it works. I'm completely stumped as to why this would consistently happen. (Prior to the Win 10 update, using pshazz and some OpenSSH all of these connections used to work flawlessly.)
I had the same problem. After playing around a bit I just scoop uninstall openssh and then removed the ssh plugin from my custom pshazz theme file. So I'm just using the windows OpenSSH. Only thing is that if you're using git with ssh it'll ask you for the passphrase every time you interact with the remote (pull, push, fetch, etc). So I would recommend https for git remotes.
Worked again after removing the ssh plugin from pshazz as @daironmichel mentions.
Most helpful comment
I had the same problem. After playing around a bit I just
scoop uninstall opensshand then removed thesshplugin from my custom pshazz theme file. So I'm just using the windows OpenSSH. Only thing is that if you're usinggitwithsshit'll ask you for the passphrase every time you interact with the remote (pull, push, fetch, etc). So I would recommendhttpsfor git remotes.