If you have a script that was created in Powershell v1 or v2, it might not work with Powershell v3 or v4. A solution to this is running the shell in another version.

To see what version of Powershell you are running, run this variable:


To change the version to v2, enter this:

powershell -version 2.0