Powershell: Detecting if a specific WWHHost app is running RRS feed

  • Question

  • We are using some of the ideas found here to automate the building and testing of our app. 

    We currently have a script that installs the app and then launches it using the Win8AppLaunch.exe refereneced in the article.  One of the problems we are having is that we cannot definitively detect that the app has launched. 

    Using powershell I can get a list of all the WWHHost apps currently running, ex.

    powershell Get-Process WWAHost

    but if multiple WWAHost apps are running, I do not have a way to detect that the proper one is running.  Is there any way to get or add identifying info so that this could be detected, perhaps through a process member?

    Wednesday, February 27, 2013 10:10 PM

All replies

  • I haven't worked with the Windows 8 app launcher yet, but I believe your best bet for getting distinguishing information is to work through WMI's Win32_Process class instead, since it contains much more detailed information:

    Get-WmiObject Win32_Process | ? {$ -eq "WWAHost.exe"} 

    The particular property of interest is Commandline, since it shows the actual commandline used at startup; CreationDate may also help since it shows precise launch time. I'd probably try this interactively to confirm:

    Get-WmiObject Win32_Process | ? {$ -eq "WWAHost.exe"} | format-table Commandline,CreationDate,ProcessID

    Sunday, March 10, 2013 3:48 PM