You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Invoke-CommandInDesktopPackage** will have a package token and identity. It's primarily designed to be used as a debugging utility.
24
+
`Invoke-CommandInDesktopPackage` creates a new process in the context of the supplied **PackageFamilyName** and **AppId**.
25
+
26
+
The created process will have the identity of the provided **AppId** and will have access to its virtualized file system and registry (if any). The new process will have a token that is similar to, but not identical to, a real **AppId** process.
27
+
28
+
The primary use-case of this command is to invoke debugging or troubleshooting tools in the context of the packaged app to easily access its virtualized resources. For example, you can run the Registry Editor to see virtualized registry keys, or Notepad to read virtualized files. See the important note that follows on using tools such as the Registry Editor that require elevation.
29
+
30
+
No guarantees are made about the behavior of the created process, other than it having the package identity and access to the package's virtualized resources. In particular, the new process will _not_ be created in an AppContainer even if an **AppId** process would normally be created in an AppContainer. Features such as Privacy Controls or other App Settings may or may not apply to the new process. You should not rely on any specific side-effects of using this command, as they are undefined and subject to change.
25
31
26
32
## EXAMPLES
27
33
28
-
### Example 1: Invoke an executable from app package
34
+
### Example 1: Invoke Notepad to read virtualized files
35
+
36
+
The following command invokes Notepad in the context of the `ContosoApp` app from the `Contoso.MyApp` package. This allows you to access resources such as a log file or configuration file stored in the app's virtualized filesystem.
This command invokes the demo.exe that can be found in '29270sandstorm.AppPackage1_gah1vdar1nn7a' app package under the 'AppPackage1' Application element.
42
+
34
43
35
44
## PARAMETERS
36
45
37
46
### -AppId
38
-
AppId is the Application ID from the package manifest.
47
+
**AppId** is the Application ID from the target package's manifest.
An executable to invoke (for example, `regedit.exe`).
83
+
84
+
Note that if the executable requires elevation (like `regedit`), you must call `Invoke-CommandInDesktopPackage` from an already-elevated context. Calling `Invoke-CommandInDesktopPackage` from a non-elevated context does not work as expected. The new process is created without the package context, and the PowerShell command fails.
Switch that causes the entire process tree to stay in the package context.
114
+
Causes all child processes of the invoked process to also be created in the context of the **AppId**. By default, child processes are created without any context. This switch is useful for running `cmd.exe` so that you can launch multiple other tools in the package context.
0 commit comments