Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
If you create a PowerShell script and we say it must be version 3.0, you can simply add this to your script:
If ((Get-Host).Version.Major.Equals(3))
{
#Your script will run here.
}
Else
{
#You can add an error message here, so the user will understand, he/she doesn't have the actual version.
}
Remember, you can not use If ((Get-Host).Version.Major = "3") or something like that, because "Major" is a locked property.