title: Get-AppxPackage command doesn't work when being launched by my application (VB.NET)
body: <p>My application's purpose is to run the GetAppxPackage code in PowerShell to install an user preferenced package (so for example feedback hub). </p>
  
  <p>The Powershell command is as follows: </p>
  
  <p><strong>get-appxpackage -allusers <em>feedback</em> | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}</strong></p>
  
  <p>(There are asterisks left and right of feedback, but stackoverflow makes it italicized)</p>
  
  <p>The above code runs normally in Powershell, when manually opening Powershell and running it.</p>
  
  <p>The following code Iam using to run in it VB.NET</p>
  
  <pre><code>Dim w3 As String = "feedback"
  
  Clipboard.SetText("get-appxpackage -allusers *" &amp; w3 &amp; "* | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register " &amp; Chr(34) &amp; "$($_.InstallLocation)\AppXManifest.xml" &amp; Chr(34) &amp; "}")
  
  Process.Start("powershell.exe", "Get-AppxPackage -allusers *" &amp; w3 &amp; "* | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register " &amp; Chr(34) &amp; "$($_.InstallLocation)\AppXManifest.xml" &amp; Chr(34) &amp; "}")
  </code></pre>
  
  <p>The clipboard is not neccesary obviously, but I used it to confirm the code is exactly the same as it should be.</p>
  
  <p>Powershell outputs the following (when being launched from my application):</p>
  
  <p>Add-AppxPackage : A Positional Parameter cannot be found that accepts argument '\AppXManifest.xml'
  At line:1 char:49
  + ... | Foreach {Add-AppxPackage -Disabledevelopmentmode -Register $($_.In ...
  +
  + Categoryinfo : InvalidArgument: (:) [Add-AppxPackage]. ParameterBindingexception
  + FullyQualifiedErrorId : PositionalParameterNotFound.Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand</p>
  
  <p>My application is running with Administrative rights, and so is Powershell.</p>
  
  <p>Do not know what the problem is, or could be, since the code is exactly the same. Would really appreciate any help towards solving this problem.</p>
  
  <p>Thank you.</p>