title: How to quickly check if WMI information can be pulled from a remote computer
body: <p>I am looking for a command (an IF test) that will run quickly to see if a computer can be connected to. I do one if-test and if it passes then I will run a slew of commands to pull the information I need. If the first test fails, then it does not run the commands as otherwise it would have to fail out on each test which would take a long time.</p>
  
  <p>The following code works, but it is very slow and results in a "GUI (Not Responding)" if the computer is not on the network. I am looking for something to check quicker if it fails.</p>
  
  <pre><code>if (Test-Path "\\$PCNAME\c`$")
  {
      # Slew of WMI commands go here.
  }
  </code></pre>
  
  <p>I sometimes query large lists of computers and if a majority of them are off, the command above will take a ton of time to complete.</p>