title: How do I remote into multiple remote computers via PS to discover one specific app and determine the version number on each remote device? No output
body: <p>FYI: I'm very new to PS and I'm using this as a learning opportunity. Again, I'm trying to find a
  specific application on a list of multiple remote devices and determine the version number of the
  application on their corresponding host system. I attempted this via a registry query (found this to
  be challenging) and then I used Get-WMIObject. As of now, I'm working with this as my script. It's
  not producing any output; instead, it returns to the command prompt with no errors or messages.</p>
  <p>Script to find specific application and version in multiple remote devices:</p>
  <pre><code>    $Servers = Get-Content -Path C:\\files\Serverlist.txt
  
      $CIMSession = New-CIMSession -ComputerName $Servers Get-Credentials
  
      $Vendor = &quot;App Name&quot;
  
  
      foreach($Serv in $Servers) {
  
      If(Test-Connection -ComputerName $Serv -Count 1 -Quiet) {
  
      $Status = Get-Ciminstance Win32_Product -Computername $Serv | Where-object {$_.Version -contains 
      $Vendor}
  
      if($Status) {
  
      Out-file -Filepath C:\\files\AppVerResults.txt
  
      }
  
      }
  
      }
  </code></pre>
  <p>I also tried adjusting the following section of the script as shown below but it presented me with the error &quot;Get-CimInstance : Access is denied.&quot; Is this error message due to group policy or so? I am able to remote into the device corresponding to the message via RDP.</p>
  <pre><code>    if($Status) {
  
       $Servers + &quot; - &quot;
  
      $Status | Out-file -Filepath C:\\files\AppVerResults.txt
  
      }
  
      }
  
      }
  </code></pre>
  <p>Should I go about it via invoke-command or registry query? I'm slowly picking things up so I'll continue my research but I was hoping to get some advice in the meantime.</p>