File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
14
+
Original file line number Diff line number Diff line change
1
+ # This script is designed to remove unnecessary or bloatware AppxPackages from Windows.
2
+ # Usage: Run this script in PowerShell with administrator privileges.
3
+ # Prerequisites: Ensure you have administrative rights to execute this script.
4
+
5
+ # Check if the script is running with elevated privileges
6
+ if (-not ([Security.Principal.WindowsPrincipal ] [Security.Principal.WindowsIdentity ]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole ] " Administrator" )) {
7
+ Write-Host " This script must be run as an administrator." - ForegroundColor Red
8
+ exit
9
+ }
10
+
11
+ # Determine and print the Windows version
12
+ $windowsVersion = (Get-ItemProperty " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" ).ProductName
13
+ Write-Host " [INFO] Windows Version: $windowsVersion "
14
+
15
+ # Define a list of AppxPackages to remove
16
+ # These packages are considered unnecessary or bloatware for many users,
17
+ # and their removal can help streamline the system and free up resources.
18
+ $appxPackages = @ (
19
+ " *Microsoft.YourPhone*" ,
20
+ " *Microsoft.Getstarted*" ,
21
+ " *Microsoft.GetHelp*" ,
22
+ " *Microsoft.XboxGamingOverlay*"
23
+ )
24
+
25
+ # Loop through each package and attempt to remove it
26
+ foreach ($package in $appxPackages ) {
27
+ try {
28
+ # Get the package
29
+ $appxPackage = Get-AppxPackage | Where-Object { $_.Name -like $package }
30
+ if ($appxPackage ) {
31
+ # Remove the package
32
+ Write-Host " Error removing package: $package . Exception: $ ( $_.Exception.Message ) "
33
+ Write-Host " Successfully removed: $package "
34
+ } else {
35
+ Write-Host " Package not found: $package "
36
+ }
37
+ } catch {
38
+ Write-Host " Error removing package: $package . Error: $_ "
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments