I am working with windows 7 and 8.1 machines. I would like to implement a PowerShell script to detect the OS and install a program based on the result.
So far I can get the OS but I get caught in the IF statement.
$Win7="6.1.7601" $Win8="Not tested yet" $Version=(Get-WmiObject win32_operatingsystem).version write-host Your windows version is $version. if(!($version="6.1.7601")) {skip} else {Install file} I am trying to skip this script and return to a main script if the OS is not win7 otherwise it should install the files needed. Any help would be much appreciated.
-eqthere?