There’s no reason to deny that PowerShell is much more powerful than the Command Prompt, so what can you do when it’s not working properly? If you also ran into an annoying problem and don’t know what to do, this is the guide for you.
Trying to run PowerShell gives you this error instead: PowerShell is not recognized as an internal or external command. Or maybe you are seeing one of the simplest, yet widely spread PowerShell errors: Term not recognized.
One case or another, we’ve got solutions for you. Check them out one by one in the lines below.
What can I do when PowerShell is not recognized?
1. Make a few changes to the path environment variable
Experienced users brag about solving the problem by easily adding this to their path environment variable: %SYSTEMROOT%System32WindowsPowerShellv1.0
Try the same too in case of missing an environment variable. If it makes no difference, you could also change your script to this: %SYSTEMROOT%System32WindowsPowerShellv1.0powershell.exe
2. Change COMMAND constant
On the other hand, if you’re unable to resolve the issues with the previous two quick fixes, this should be your next obvious step.
Find your way to the win32.js at say/platform/win32.js. While there, change the COMMAND constant from powershell to start /b powershell.
3. Evoke the 64-bit version from Visual Studio when PowerShell commands are not recognized
If you’re dealing with PowerShell commands not recognized when called from Visual Studio 2017, start from here: Visual Studio 2017 is 32-bit, therefore it evokes the 32-bit version of PowerShell.
Starting PowerShell manually on 64-bit Windows means using the 64-bit version of PowerShell, so that’s the root of the problem itself.
In this case, evoke specifically the 64-bit version from Visual Studio by using this syntax:
4. Check spelling when getting the Term not recognized error
When the error you are seeing states that a term is not recognized as the name of a cmdlet, function, script file, or operable program, things are a lot easier.
All you need to do is to further check the spelling of the name. If a path was included, then make sure the path is correct and try again.
Moreover, it seems that adding PowerShell to the path seems to fix the issue. However, there’s a downside to take into consideration. Not everyone is interested to add PowerShell to the path; you might just look for a way to install and use the package.
Have these procedures been successful? Use the comments area to let us know.