Edit

Share via


Invoke-CommandInDesktopPackage

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

Syntax

Default (Default)

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

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.

Parameters

-AppId

AppId is the Application ID from the package manifest.

<Application Id="blah" ... />

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Args

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Command

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PackageFamilyName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PreventBreakaway

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

System.Management.Automation.SwitchParameter

Outputs

Object