title: Running Powershell Command from VBS gets stuck
body: <p>I have a strange problem when launching Powershell commands from VBS.</p>
  <p>Sometimes, it works and sometimes, not.
  It occurs on startup scripts or GPOs (SYSTEM and USER permissions)</p>
  <p>I don't see the issue when launching ps1 files instead, only with -command.
  The powershell opens (in taskmgr), doesn't exit, does nothing and there's a memory leak.</p>
  <p>Here's two example of the code, it may stuck on any powershell -command.
  Tried -NoProfile, -NonInteractive, Exit-PSSession, Exit, etc.</p>
  <pre><code>objShell.run(&quot;powershell -NoProfile -NoLogo -NonInteractive -command &quot;&quot;&amp; {Set-ExecutionPolicy unrestricted; import-module 'C:\Program Files\Microsoft Application Virtualization\Client\Appvclient'}&quot;&quot;&quot;, 0, True)
  
  objShell.run &quot;powershell -command &quot;&quot;&amp; { add-appxpackage -registerbyfamilyname -MainPackage Microsoft.Windows.Photos_8wekyb3d8bbwe }&quot;&quot;&quot;,0,true 
  </code></pre>
  <ul>
  <li>OS: Windows 10 Education 20H2</li>
  <li>Powershell: 5.1.19041.1320</li>
  </ul>