RSS

test your Powershell version by yourself

14 Feb

code

if (Test-Path variable:psversiontable) {
$versionPresent = $psversiontable.buildversion
if (($versionPresent.Major -eq 6) -and
(($versionPresent.Build -gt 6002) -or
(($versionPresent.Build -eq 6002) -and ($versionPresent.Revision -ge 18111))
)) {"V2 RTM"}
else {
if ($versionPresent.Major -gt 6) {" Are you using Windows 8? "}
else { "Need to Update to V2 RTM from http://support.microsoft.com/kb/968929" }
}
} else {
"you are using V1,please Update to V2 RTM from http://support.microsoft.com/kb/968929"
}

 

 

for Windows 7 and Windows server 2008 R2 please ignor this, because they are ship with native Powershell  V2 RTM

Advertisements
 
Leave a comment

Posted by on February 14, 2010 in Powershell

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: