How to run a Metro-App from PowerShell on Windows 8? How to run a Metro-App from PowerShell on Windows 8? powershell powershell

How to run a Metro-App from PowerShell on Windows 8?


There is no direct way to do this but there are a couple indirect ways.

vsdebuglaunchnotify, which comes with Visual Studio, can be called from PowerShell.

You could create your own exe that uses IApplicationActivationManager.

If the app is associated with any file types you could launch an associated file.

More information is covered in this thread on MSDN:

http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/8d1b0861-5903-4289-8cb8-541ddaa012fb


Here's a blog post by Powertoe that uses the IApplicationActivationManager way of doing it:

http://powertoe.wordpress.com/2012/11/02/get-a-list-of-metro-apps-and-launch-them-in-windows-8-using-powershell/

He provides code here http://poshcode.org/3740 that provides a Start-MetroApp commandlet for powershell.

Alternatively: I think some Metro Apps have protocol handlers, so that you can talk to them via a URI (e.g. "appname:dosomething") but I'm not sure how widely used this is.