1
votes

What's the problem I'm having? I get the following error when running 'az login' from the terminal in Visual Studio code:

/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe: Invalid argument

What's the environment? I'm running Visual Studio code in Windows 10 (version 1809, OS build 17763. 1158). I'm using Ubuntu 18.04 with WSL 1 and I've set my terminal to use "C:\Windows\System32\bash.exe"

I seem to have problems with PowerShell launching from VS code. Does anyone know if it's possible to configure VS code to use cmd rather than PowerShell when doing an az login? Any other suggestions are welcome. Thanks.

1
Any updates for the question? Does it solve your problem? - Charles Xu
Thanks Charles, this certainly answers the question I asked. The specific issue I was having (which wasn't the question I asked) was that my az login would throw an invalid argument error in this scenario and I would have to use Ctrl + Z to get back to a command, this was solved by running sudo az login in order to successfully log in. - Richard Woodward

1 Answers

0
votes

For the Visual Code, you can set the default shell as cmd if you want to use the cmd when you need the terminal. It looks like this:

1. enter image description here

2. enter image description here

When you finish these two actions, then you can get the cmd terminal when you want a new one. In this way, the cmd is the default.