powershell - OS version IF statement -


i working windows 7 , 8.1 machines. implement powershell script detect os , install program based on result.

so far can os caught in if statement.

$win7="6.1.7601"    $win8="not tested yet"   $version=(get-wmiobject win32_operatingsystem).version   write-host windows version $version.    if(!($version="6.1.7601"))     {skip}   else     {install file}    

i trying skip script , return main script if os not win7 otherwise should install files needed. appreciated.

the = operator used set value of something. need use -eq operator, compares objects.

if(!($version -eq "6.1.7601"))


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -