Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: This will Remove all Appxpackages
- ::
- $AppsList = 'Microsoft.3DBuilder',
- 'Microsoft.BingFinance',
- 'Microsoft.BingNews',
- 'Microsoft.BingSports',
- 'Microsoft.MicrosoftSolitaireCollection',
- 'Microsoft.People',
- 'Microsoft.Windows.Photos',
- 'Microsoft.WindowsCamera',
- 'microsoft.windowscommunicationsapps',
- 'Microsoft.WindowsPhone',
- 'Microsoft.WindowsSoundRecorder',
- 'Microsoft.XboxApp',
- 'Microsoft.ZuneMusic',
- 'Microsoft.ZuneVideo',
- 'Microsoft.Getstarted',
- 'Microsoft.WindowsFeedbackHub',
- 'Microsoft.XboxIdentityProvider',
- 'Microsoft.MicrosoftOfficeHub',
- 'Fitbit.FitbitCoach',
- 'ThumbmunkeysLtd.PhototasticCollage',
- 'Microsoft.People'
- C:\Batch\PSEXEC.EXE -s powershell -c
- Start-Transscript -Path 'C:\RemoveAllAppxPackages.txt'
- ForEach ($App in $AppsList){
- $PackageFullName = (Get-AppxPackage -AllUsers $App).PackageFullName
- $ProPackageFullName = (Get-AppxProvisionedPackage -AllUsers | where {$_.Displayname -eq $App}).PackageName
- $PackageFullName | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- $ProPackageFullName | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- if ($PackageFullName){
- "Removing Package: $App" | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- remove-AppxPackage -package $PackageFullName -AllUsers | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- ) pause
- }
- else{
- "Unable to find package: $App" | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- pause
- }
- if ($ProPackageFullName){
- "Removing Provisioned Package: $ProPackageFullName" | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- Remove-AppxProvisionedPackage -online -packagename $ProPackageFullName | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- pause
- }
- else{
- "Unable to find provisioned package: $App" | out-File -FilePath C:\RemoveAllAppxPackages.txt -Append
- pause
- }
- }
- Pause
- Stop-Transcript
- :: To remove just the one package causing the problem, use I used the following line:
- ::C:\Batch\psexec -s powershell -c "Get-AppxPackage -all | where name -eq "APP.NAME" | Remove-AppxPackage"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement