From 987ebf21968f6b32b97e01fb757b9bc2f6b8af0f Mon Sep 17 00:00:00 2001 From: nahaku <68815071+nahaku@users.noreply.github.com> Date: Wed, 5 May 2021 05:04:13 +0000 Subject: [PATCH] Add files via upload --- Windows App Cleaner.ps1 | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Windows App Cleaner.ps1 diff --git a/Windows App Cleaner.ps1 b/Windows App Cleaner.ps1 new file mode 100644 index 0000000..e121678 --- /dev/null +++ b/Windows App Cleaner.ps1 @@ -0,0 +1,60 @@ +# Lists all app packages on system {-AllUsers > will return all apps, even not logged users} +#Get-AppxPackage -AllUsers | Select Name, PackageFullName + +# Removes the app from Windows +#Get-AppxPackage Microsoft.XboxApp | Remove-AppxPackage + +# Lists all app packages on system, and stores the result in csv file +#Get-AppxPackage -AllUsers | Select Name, PackageFullName | export-csv -Path c:\apps.csv -NoTypeInformation + +$unwanted = [ + "Microsoft.GetHelp", + "Microsoft.Getstarted", + "Microsoft.MicrosoftOfficeHub", + "Microsoft.MicrosoftSolitaireCollection", + "Microsoft.MicrosoftStickyNotes", + "Microsoft.MixedReality.Portal", + "Microsoft.Office.OneNote", + "Microsoft.People", + "Microsoft.Wallet", + "Microsoft.WindowsAlarms", + "Microsoft.WindowsFeedbackHub", + "Microsoft.WindowsMaps", + "Microsoft.Xbox.TCUI", + "Microsoft.XboxApp", + "Microsoft.XboxGameOverlay", + "Microsoft.XboxApp", + "Microsoft.XboxIdentityProvider", + "Microsoft.XboxSpeechToTextOverlay", + "Microsoft.YourPhone", + "Microsoft.ZuneMusic", + "Microsoft.ZuneVideo", + "Microsoft.BingWeather", + "Microsoft.Microsoft3DViewer" + ] + +# Creates Function for clean up +function CleanUp { + Get-AppxPackage | Select Name | ForEach-Object { + $AppName = $_.Name # Creates variable from Object + if($unwanted -contains $AppName) { + Write-Host Removing: $AppName + Get-AppxPackage $AppName -AllUsers | Remove-AppxPackage -AllUsers + } + elseif($AppName -contains "Microsoft.549981C3F5F10") { + Write-Host Removing: Cortana + Get-AppxPackage $AppName -AllUsers | Remove-AppxPackage -AllUsers + } + } + Write-Host "**** All useless apps been deleted :) ****" + Write-Host "**** Window will close now ****" + +# Waits 5 seconds + Start-Sleep -s 5 + +# Exits the Powershell + stop-process -Id $PID +} +# Runs the Function Clean up +CleanUp +