title: Powershell Check Windows OS Version on Remote workstation
body: <p>I am looking to find out on a remote workstation it's version of windows. 
  I need to pull the information from $OSCheck then check if it matches a version of Windows.</p>
  
  <pre><code>$computer = read-host "Computer Name "
  $UserName = Read-Host "Enter User Name "
  $Password = Read-Host -AsSecureString "Enter Your Password "
  $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $UserName , $Password
  #Check Workstation#
  $OSCheck = (Get-WmiObject -comp $computer -Credential $Credential -class Win32_OperatingSystem ).Caption    
  $OSCheck
  Write-Host ""
  #Write-Host "OS Version is - " $OSCheck
  Write-Host ""
  
  If ($OSCheck  -match "Microsoft Windows 7 Professional" )
  {
      Write-Host "OSCheck is Microsoft Windows 7 Professional"
  }
  Else
  {
      Write-Host "Not Windows 7"
  }
  </code></pre>