Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 2 characters in body; edited title
Source Link
marc_s
  • 760k
  • 186
  • 1.4k
  • 1.5k

OS version IF statmentstatement

I am working with windows 7 and 8.1 machines. I would like to implement a powershellPowerShell 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.

OS version IF statment

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.

OS version IF statement

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.

Source Link

OS version IF statment

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.