Powershell problem when changing channel from Stable to Master in Flutter SDK

Viewed 15360

After changing the Flutter SDK channel from Stable to Master I now get this error when running Flutter commands:

Error: PowerShell executable not found.
       Either pwsh.exe or PowerShell.exe must be in your PATH.
4 Answers

Add powershell.exe to your path in environment variables. You can find it under:

C:\Windows\System32\WindowsPowerShell\v1.0

Go to System Properties -> Advanced System setting -> Environment Variable -> User variables - > Path

Add powershell.exe to your path in environment variables. You can find it here

C:\Windows\System32\WindowsPowerShell\v1.0

I ran into this issue as well and was able to solve it as mentioned by @pallav-bohara and @ashirbad. But just wanted to add some complementary configurations you might need as well. Following procedure tested in Windows 10:

  1. Add this to the User-level environment variable PATH, if you don't have:

C:\Windows\System32

  1. Add PowerShell path to User-level environment variable PATH, as Flutter tools depends on PowerShell 5.0 and above. But better place the paths of Step-1 & Step-2 before flutter or npm path:

%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

Note: Of course, you should also ensure to have your flutter bin correctly set.

I actually found this solution here which saved some valuable time and wanted to summarize all the important points.

Related