Add-AppxPackage

Add-AppxPackage

Adds a signed app package to a user account.

Syntax

Parameter Set: AddSet
Add-AppxPackage [-Path] <String> [-DependencyPath <String[]> ] [-ForceApplicationShutdown] [-ForceTargetApplicationShutdown] [-InstallAllResources] [-Volume <AppxVolume> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RegisterByPackageFullNameSet
Add-AppxPackage -MainPackage <String> [-DependencyPackages <String[]> ] [-ForceTargetApplicationShutdown] [-InstallAllResources] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RegisterSet
Add-AppxPackage [-Path] <String> -Register [-DependencyPath <String[]> ] [-DisableDevelopmentMode] [-ForceApplicationShutdown] [-ForceTargetApplicationShutdown] [-InstallAllResources] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: UpdateSet
Add-AppxPackage [-Path] <String> -Update [-DependencyPath <String[]> ] [-ForceApplicationShutdown] [-ForceTargetApplicationShutdown] [-InstallAllResources] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The Add-AppxPackage cmdlet adds a signed app package to a user account. An app package has an .appx file name extension. Use the DependencyPath parameter to add all other packages that are required for the installation of the app package.

You can use the Register parameter to install from a folder of unpackaged files during development of Windows® Store-Apps.

To update an already installed package, the new package must have the same package family name.

Parameter

-DependencyPackages<String[]>

Specifies the dependency package full name or dependency package bundle full name to be registered.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-DependencyPath<String[]>

Specifies an array of file paths of dependency packages that are required for the installation of the app package. The app package has an .appx or .appxbundle file name extension. You can specify the paths to more than one dependency package.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-DisableDevelopmentMode

Indicates that this cmdlet registers an existing app package installation that has been disabled, did not register, or has become corrupted. Use the current parameter to specify that the manifest is from an existing installation, and not from a collection of files in development mode. You can also use this parameter to register an application that the Package Manager API has staged. Use the Register parameter to specify the location of the app package manifest .xml file from the installation location.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ForceApplicationShutdown

Indicates that this cmdlet forces all active processes that are associated with the package or its dependencies to shut down. If you specify this parameter, do not specify the ForceTargetApplicationShutdown parameter.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ForceTargetApplicationShutdown

Indicates that this cmdlet forces all active processes that are associated with the package to shut down. If you specify this parameter, do not specify the ForceApplicationShutdown parameter.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-InstallAllResources

Indicates that this cmdlet forces the deployment of all resource packages specified from a bundle argument. This overrides the resource applicability check of the deployment engine and forces staging of all resource packages, registration of all resource packages, or staging and registration of all resource packages. This parameter can only be used when specifying a resource bundle or resource bundle manifest.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-MainPackage<String>

Specifies the main package full name or bundle full name to register.

Aliase

none

Erforderlich?

true

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-Path<String>

Specifies the file path of the app package. An app package has an .appx or .appxbundle file name extension.

Aliase

PSPath

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

true (ByValue)

Platzhalterzeichen akzeptieren?

false

-Register

Indicates that this cmdlet registers an application in development mode. You can use development mode to install applications from a folder of unpackaged files. You can use the current parameter to test your Windows® Store-Apps before you deploy them as app packages. To register an existing app package installation, you must specify the DisableDevelopmentMode parameter and the Register parameter. In order to specify dependency packages, specify the DependencyPath parameter and the DisableDevelopmentMode parameter.

Aliase

none

Erforderlich?

true

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Update

Specifies that the package being added is a dependency package update. A dependency package is removed from the user account when the parent app is removed. If you do not use this parameter, the package being added is a primary package and is not removed from the user account if the parent app is removed. To update an already installed package, the new package must have the same package family name.

Aliase

none

Erforderlich?

true

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Volume<AppxVolume>

Specifies the AppxVolume object to which to stage the package. The volume also specifies the default location for user AppData.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

true(ByValue,ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Confirm

Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.

  • System.String[]
  • System.IO.FileInfo

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • None

Beispiele

Example 1: Add an app package

This command adds an app package that the package contains.

PS C:\> Add-AppxPackage -Path "C:\Users\user1\Desktop\MyApp.appx" –DependencyPath "C:\Users\user1\Desktop\winjs.appx"

Example 2: Add a disabled app package in development mode

This command gets the full path of the package manifest file of an installed Windows Store app, and then registers that package. You can use DisableDevelopmentMode to register an application that is staged by the StagePackageAsync API, has been disabled, or has become corrupted during testing.

PS C:\> $ManifestPath = (Get-AppxPackage -Name "*WindowsCalculator*").InstallLocation + "\Appxmanifest.xml"
PS C:\> Add-AppxPackage -Path $ManifestPath -Register –DisableDevelopmentMode

Verwandte Themen

Get-AppxPackage

Get-AppxPackageManifest

Move-AppxPackage

Remove-AppxPackage

Package Manager API

How to Add and Remove Apps