IT:AD:PowerShell:HowTo:Snippets:Check Powershell Version
Summary
It's good to nudge end users to upgrade their dependencies, and not get too out of date/holding us all back.
Process
function Check_Powershell_Version([int]$minVersion){
if(!$PSVersionTable -or !$PSVersionTable.PSVersion){
#probably version 1, which is seriously old.
return false;
}
return ($PSVersionTable.PSVersion.Major>=$minVersion);
}