3

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.
MendelG
  • 4,464
  • 1
  • 5
  • 22
AliAzad
  • 93
  • 1
  • 10

4 Answers4

6

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

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

MendelG
  • 4,464
  • 1
  • 5
  • 22
pallav bohara
  • 3,699
  • 6
  • 17
  • 39
2

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

ashirbad
  • 21
  • 1
  • 3
0

Solved my problem after installing Windows Management Framework 5.1

Link: https://www.microsoft.com/en-us/download/confirmation.aspx?id=54616.

AliAzad
  • 93
  • 1
  • 10
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.

KPandian
  • 1,000
  • 7
  • 8