Elsewhere on the internet, there is advice that the 'best' way to launch a "Windows 10 app" aka UWP app is via a new explorer.exe process, using the 'shell:' protocol, (If it hasn't registered it's own protocol)
param([string]$AppName)
$Path="shell:appsfolder\"+(Get-AppXPackage | where{$_.Name -match "$AppName"} | select -expandproperty packagefamilyname)+"!App"
return $Pathhowever, calling this script results in
PS C:\Users\RyanLeach\Documents\WindowsPowerShell\Scripts> $ShareX = ./findapp.ps1 ShareX
PS C:\Users\RyanLeach\Documents\WindowsPowerShell\Scripts> $ShareX
shell:appsfolder\19568ShareX.ShareX_egrzcvs15399j!App
PS C:\Users\RyanLeach\Documents\WindowsPowerShell\Scripts> Start-Process -FilePath $ShareX
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1
+ Start-Process -FilePath $ShareX
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommandSo how can you launch a Store app (Desktop or UWP) via command-line / PowerShell, passing arguments?
21 Answer
Try:
Start-Process -FilePath "explorer.exe" "shell:appsFolder\19568ShareX.ShareX_egrzcvs15399j!App" 5