Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

As mentioned by others, you need to save the code in a .ps1 file and not .bat.

This line (from Setting Windows PowerShell environment variablesSetting Windows PowerShell environment variables) will do the trick:

$env:Path = $env:Path + ";C:\Users\Brett\Compilers\MinGW\bin" 

Or even shorter:

$env:Path += ";C:\Users\Brett\Compilers\MinGW\bin" 

As mentioned by others, you need to save the code in a .ps1 file and not .bat.

This line (from Setting Windows PowerShell environment variables) will do the trick:

$env:Path = $env:Path + ";C:\Users\Brett\Compilers\MinGW\bin" 

Or even shorter:

$env:Path += ";C:\Users\Brett\Compilers\MinGW\bin" 

As mentioned by others, you need to save the code in a .ps1 file and not .bat.

This line (from Setting Windows PowerShell environment variables) will do the trick:

$env:Path = $env:Path + ";C:\Users\Brett\Compilers\MinGW\bin" 

Or even shorter:

$env:Path += ";C:\Users\Brett\Compilers\MinGW\bin" 
Source Link
Joost
  • 1.2k
  • 1
  • 11
  • 19

As mentioned by others, you need to save the code in a .ps1 file and not .bat.

This line (from Setting Windows PowerShell environment variables) will do the trick:

$env:Path = $env:Path + ";C:\Users\Brett\Compilers\MinGW\bin" 

Or even shorter:

$env:Path += ";C:\Users\Brett\Compilers\MinGW\bin"