title: Test if powershell remoting is enabled
body: <p>I have been looking and can't find specifically what I am looking for, I need a way that I can test about 900 machines and tell whether or not powershell remoting is enabled, I figured out that with the script below I can verify that powershell is installed but it doesn't check that it can actually remotely manage the machine, any ideas?</p>
  
  <pre><code>function Check-PSVersion
  {
  
  [CmdletBinding()]
  Param (
      [Parameter(Mandatory = $true)]
      $ComputerName
  )
  if (Test-Path $ComputerName)
  {
      $Computers = Get-Content $ComputerName
  }
  Else
  {
      $Computers = $ComputerName
  }
  
  Foreach ($Computer in $Computers)
  {
      Try
      {
          Write-Host "Checking Computer $Computer"
          $path = "\\$Computer\C$\windows\System32\WindowsPowerShell\v1.0\powershell.exe"
          if (test-path $path) { (ls $path).VersionInfo }
          else
          {
              Write-Host "Powershell isn't installed" -ForegroundColor 'Red'
          }
          Write-Host "Finished Checking Computer $Computer"
      }
  
      catch { }
  }
  }
  </code></pre>