title: Executing PowerShell script remotely yields different results
body: <p>I've written a C# code that's supposed to retrieve all installed Appx packages on a Win8 machine. When running it locally I get the expected results. However, while running it remotely from a different host I get unusual results - meaning I don't get all the packages installed. This also changes from execution to execution - including running it twice consecutively from the same host and on the same machine without any changes. </p>
  
  <p>This is the basic structure of the code:</p>
  
  <pre><code>PowerShell powerShell = PowerShell.Create();
  
  powerShell.AddCommand("Get-AppxPackage");
  
  Collection&lt;PSObject&gt; psObjects = powerShell.Invoke();
  </code></pre>
  
  <p>Has anyone experienced this before? What could be causing this? (I'm running the script as an Admin on the target machine)</p>
  
  <p>Thanks in advance</p>