Remove-AppxPackage

Remove an app package from a user account.

Syntax
      Remove-AppxPackage [-Package] String [-PreserveApplicationData]
         [-Confirm] [-WhatIf] [CommonParameters]

Key
   -Package String
       An AppxPackage object or the full name of the package to be removed.
        
   -PreserveApplicationData
       Preserve the application data during package removal.
       The application data is available for later use.
        
   -Confirm
       Prompt for confirmation before running the cmdlet.
        
   -WhatIf
       Shows what would happen if the cmdlet runs. The cmdlet is not run.

Get-AppxPackage gets a list of the app packages that are installed in a user profile.

An app package has an .appx file name extension. To get the list of packages for a user profile other than the profile for the current user, you must run this command by using administrator permissions.

This cmdlet was introduced in Windows PowerShell 5.0.

Examples

Remove the app package named package1_1.0.0.0_neutral__8wekyb3d8bbwe from the current user account:

PS C:\> Remove-AppxPackage -Package "package1_1.0.0.0_neutral__8wekyb3d8bbwe"

Remove a specific app package using a wildcard match on the name:

PS C:\> Get-AppxPackage -Package "package1_1.0.0.0_neutral*" | Remove-AppxPackage -confirm

Remove CoPilot:

# Get the full package name of the Copilot app
$packName = Get-AppxPackage -Name "Microsoft.Copilot" | Select-Object -ExpandProperty PackageFullName

# Remove the Copilot app
Remove-AppxPackage -Package $packName

“No law can give power to private persons; every law transfers power from private persons to government” ~ Isabel Paterson

Related PowerShell Cmdlets

Get-AppXPackage - List the app packages installed in a user profile.
Remove-AppxProvisionedPackage - Remove an app package (.appx) from a Windows image.
Remove Default Apps - Script.


 
Copyright © 1999-2025 windevcluster.com
Some rights reserved