Class Powershell {
$version
Powershell($profile) {
}
SetVersion($version) { try { [ValidateSet(5, 5.1, "5", "5.1", 7, 7.4, "7", "7.4")]$_version = $version}
catch {
Write-Host "SetVersion IllegalArgumentException version == $version. See method header for list of valid args -ForegroundColor DarkRed
Write-Host "Exiting Script..." -ForegroundColor DarkRed
exit
}
*rest of function*
}
}