Invoke-CommandInDesktopPackage

Runs a command in the context of a specified app package.

Syntax

Invoke-CommandInDesktopPackage
      [-PackageFamilyName] <String>
      [-AppId] <String>
      [-Command] <String>
      [[-Args] <String>]
      [-PreventBreakaway]

Description

Invoke-CommandInDesktopPackage will have a package token and identity. It's primarily designed to be used as a debugging utility.

Examples

Example 1: Invoke an executable from app package

PS C:\> Invoke-CommandInDesktopPackage -AppId "AppPackage1" -PackageFamilyName "29270sandstorm.AppPackage1_gah1vdar1nn7a" -Command "demo.exe"

This command invokes the demo.exe that can be found in '29270sandstorm.AppPackage1_gah1vdar1nn7a' app package under the 'AppPackage1' Application element.

Required Parameters

-AppId

AppId is the Application ID from the package manifest. <Application Id="blah" ... />

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-Command

An executable to invoke (e.g. "cmd.exe")

Type:String
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-PackageFamilyName

Family Name of the package. You can retrieve this by calling Get-AppxPackage.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-Args

Optional arguments that should be passed to the Command (e.g. "/od")

Type:String
Position:4
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-PreventBreakaway

Switch that causes the entire process tree to stay in the pacakge context.

Type:SwitchParameter
Position:5
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Inputs

System.String

System.Management.Automation.SwitchParameter

Outputs

System.Object