The AppID is composed of the family package name (e.g. In older versions, you must determine the AppID manually, which is quite cumbersome, unfortunately: read on. If you're unsure of the full display name, you can use a substring to find matching applications e.g. Note: The reason for Select-Object -First 1 is that even specifying the exact display name can result in multiple results, such as for Microsoft Edge. Thus, if you know an application's full display name, e.g., Photos, you can launch it as follows: Start-Process "shell:AppsFolder\$((Get-StartApps Photos | Select-Object -First 1).AppId)" In Windows 10 and above, you can now use the Get-StartApps cmdlet to list all installed AppX applications or search by (part of) their display name, which reports their AppIDs. If a given application doesn't define a URI protocol scheme, you must - somewhat obscurely - launch it via its AppId (application ID), and the general shell: URI protocol scheme and the virtual AppsFolder shell folder e.g., to launch Calculator: Start-Process shell:AppsFolder\Microsoft.WindowsCalculator_8wekyb3d8bbwe!App Launching Microsoft Store applications that do not have a URI protocol scheme defined: Protocols : Īs you can see, the Microsoft Photos application has several protocol schemes associated with it, but the obvious candidate for simply launching the application is ms-photos:, which indeed works. PS> Get-AppXUriProtocol *Photos* | Format-List # isn't supported in PowerShell (Core), as of v7.1. # * Must be run in *Windows PowerShell*, because the AppX module # * Requires custom function Get-AppXUriProtocol from the linked answer. Using a URI protocol scheme such as ms-photos: is the simplest approach, although discovering a given Microsoft Store's application's protocol(s) is non-trivial - see this answer, which provides a helper function, Get-AppXUriProtocol, which builds on the standard Note: That Start-Process -Wait (and -PassThru) cannot be used with at least some Microsoft Store applications is unfortunate the problem has been reported in GitHub issue #10996. (Get-Process Microsoft.Photos).WaitForExit() # The relevant process name was obtained with: Get-Process *Photos* # Wait for the process to exit (from what I can tell there's only ever 1 # Note: Unfortunately, -Wait does *not* work in this case. # Use the URI scheme of the Microsoft.Photos application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |