Check-PSVersion
Q: How to be sure the script will run with the installed version of Powershell?
A: Add a function to check the PowerShell host version at the begining of the script, and ‘break’ if it’s not the right version…
Check the PowerShell host version | Check compatibility