Remove-AppxPackage is accessible with the help of Appx module. To configure Appx, go through this link.
Synopsis
Removes an app package from a user account.
Description
The Remove-AppxPackage cmdlet removes an app package from a user account. An app package has an .appx file name extension.
Parameters
-AllUsers
This cmdlet removes the app package for all user accounts on the computer. This cmdlet works off the parent package type. If it is a bundle, use -PackageTypeFilter and specify the bundle. To use this parameter, you must run the command by using administrator permissions.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Package
Specifies an AppxPackage object or the full name of a package.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
-PreserveApplicationData
Specifies that the cmdlet preserves the application data during the package removal. The application data is available for later use. Note that this is only applicable for apps that are under development so this option can only be specified for apps that are registered from file layout (Loose file registered).
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-User
If you specify this parameter, the cmdlet removes the app package for only the user that this cmdlet specifies. To remove a package for a user profile other than the profile of the current user, you must run this command by using administrator permissions.
Note
- This parameter only accepts user SIDs
- Use the whoami /user command to display the current SID of a user. See whoami syntax for details.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Syntax
Remove-AppxPackage [-Package] [-PreserveApplicationData] [-WhatIf] [-Confirm] []
Remove-AppxPackage [-Package] [-AllUsers] [-WhatIf] [-Confirm] []
Remove-AppxPackage [-Package] -User [-WhatIf] [-Confirm] []
————Example 1————
Remove an app package
PS C:> Remove-AppxPackage -Package “package01”
This command removes an app package named package01 from the account of the current user.
You can check the Version, CommandType and Source of this cmdlet by giving below command.
Get-Command Remove-AppxPackage
You can also read about
- Get-AppxPackage
- Get-AppxPackageManifest
- Add-AppxPackage
- Move-AppxPackage
- Get-AppxLog
- Get-AppxLastError