Enforce a minimum PowerShell version
suggest change#requires -version 4
If you run this script on an older version, you see an error like this:
.\script.ps1 : The script ‘script.ps1’ cannot be run because it contained a “#requires” statement at line 1 for Windows PowerShell version 4.0. The version required by the script does not match the currently running version of Windows PowerShell version 2.0.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents