Invoke-CommandInDesktopPackage
Invoke-CommandInDesktopPackage is accessible with the help of Appx module. To configure Appx, go through this link.
Synopsis
Runs a command in the context of a specified app package.
Description
Invoke-CommandInDesktopPackage will have a package token and identity. It’s primarily designed to be used as a debugging utility.
Parameters
-AppId
AppId is the Application ID from the package manifest.
Type: | String |
Position: | 2 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName, ByValue) |
Accept wildcard characters: | False |
-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 |
-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 |
-PreventBreakaway
Switch that causes the entire process tree to stay in the package context.
Type: | SwitchParameter |
Position: | 5 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName, ByValue) |
Accept wildcard characters: | False |
Syntax
Invoke-CommandInDesktopPackage [-PackageFamilyName] <String> [[-AppId] <String>] [-Command] <String> [[-Args] <String>] [-PreventBreakaway] [<CommonParameters>]
———————Example 1———————
Invoke an executable from app package
PS C:\> Invoke-CommandInDesktopPackage -AppId “AppPackage01” -PackageFamilyName “Package01” -Command “demo.exe”
This command invokes the demo.exe that can be found in ‘Package01’ app package under the ‘AppPackage01’ Application element.
You can check the Version, CommandType and Source of this cmdlet by giving below command.
Get-Command Invoke-CommandInDesktopPackage
You can also read about
- Get-AppxPackage