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

Get-Command Invoke-CommandInDesktopPackage powershell script command cmdlet appx

You can also read about

  • Get-AppxPackage

To know more PowerShell cmdlets(Commands) on Appx click here

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Leave a Reply

Your email address will not be published. Required fields are marked *