Created
July 25, 2017 16:41
-
-
Save vamseekolluri/5a3bdb75aebfe5694ed738d0be8fa27d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls | |
$psver=$PSVersionTable.PSVersion.Major | |
$mystr="aaa" | |
$myarr="aaa","bbb","ccc" | |
if($psver -eq 2) | |
{ | |
write-host "Executing on Version 2" | |
$myarr -contains $mystr | |
} | |
elseif($psver -eq 5) | |
{ | |
write-host "Executing on Version 5" | |
$mystr -in $myarr #this statement results in error on PS2.0 environment. Error message is "You must provide a value expression on the right-hand side of the '-' operator" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment