Skip to content

Commit b7121d1

Browse files
committed
Merge to 'main' branch compiler-improvement/remove-trailing-whitespace
2 parents a11227d + 84a84fd commit b7121d1

File tree

4 files changed

+178
-146
lines changed

4 files changed

+178
-146
lines changed

config/tweaks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3165,7 +3165,7 @@
31653165
"panel": "1",
31663166
"Order": "a040_",
31673167
"Type": "Combobox",
3168-
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Level3 Open_DNS Quad9"
3168+
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Open_DNS Quad9 AdGuard_Ads_Trackers AdGuard_Ads_Trackers_Malware_Adult"
31693169
},
31703170
"WPFTweaksbutton": {
31713171
"Content": "Run Tweaks",

docs/faq.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# FAQ's
22

33
## How do I uninstall WinUtil?
4-
* You do not have to uninstall WinUtil. As it is a script you run from PowerShell, it only loads into your RAM. This means that as soon as you close WinUtil, it will be deleted from your system.
4+
* You do not have to uninstall WinUtil. As it is a script you run from Powershell it only loads into your RAM. This means as soon as you close WinUtil it will be deleted off your system.
5+
6+
## I applied a tweak and now something doesn't work, what do I do?
7+
* If you applied a tweak and it breaks something, you can always revert the tweak by selecting the tweak and clicking "Undo Selected Tweaks".

functions/private/Invoke-MicroWin-Helper.ps1

+85-71
Original file line numberDiff line numberDiff line change
@@ -38,90 +38,104 @@ function Remove-Features([switch] $dumpFeatures = $false, [switch] $keepDefender
3838
Remove-Features -keepDefender:$false
3939
4040
#>
41-
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir).FeatureName
42-
if ($dumpFeatures)
41+
try
4342
{
44-
$featlist > allfeaturesdump.txt
45-
}
43+
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir).FeatureName
44+
if ($dumpFeatures)
45+
{
46+
$featlist > allfeaturesdump.txt
47+
}
4648

47-
$featlist = $featlist | Where-Object {
48-
$_ -NotLike "*Printing*" -AND
49-
$_ -NotLike "*TelnetClient*" -AND
50-
$_ -NotLike "*PowerShell*" -AND
51-
$_ -NotLike "*NetFx*" -AND
52-
$_ -NotLike "*Media*" -AND
53-
$_ -NotLike "*NFS*"
54-
}
49+
$featlist = $featlist | Where-Object {
50+
$_ -NotLike "*Printing*" -AND
51+
$_ -NotLike "*TelnetClient*" -AND
52+
$_ -NotLike "*PowerShell*" -AND
53+
$_ -NotLike "*NetFx*" -AND
54+
$_ -NotLike "*Media*" -AND
55+
$_ -NotLike "*NFS*"
56+
}
5557

56-
if ($keepDefender) { $featlist = $featlist | Where-Object { $_ -NotLike "*Defender*" }}
58+
if ($keepDefender) { $featlist = $featlist | Where-Object { $_ -NotLike "*Defender*" }}
5759

58-
foreach($feature in $featlist)
60+
foreach($feature in $featlist)
61+
{
62+
$status = "Removing feature $feature"
63+
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
64+
Write-Debug "Removing feature $feature"
65+
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $feature -Remove -ErrorAction SilentlyContinue -NoRestart
66+
}
67+
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
68+
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
69+
}
70+
catch
5971
{
60-
$status = "Removing feature $feature"
61-
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
62-
Write-Debug "Removing feature $feature"
63-
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $feature -Remove -ErrorAction SilentlyContinue -NoRestart
72+
Write-Host "Unable to get information about the features. MicroWin processing will continue, but features will not be processed"
6473
}
65-
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
66-
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
6774
}
6875

6976
function Remove-Packages
7077
{
71-
$pkglist = (Get-WindowsPackage -Path "$scratchDir").PackageName
72-
73-
$pkglist = $pkglist | Where-Object {
74-
$_ -NotLike "*ApplicationModel*" -AND
75-
$_ -NotLike "*indows-Client-LanguagePack*" -AND
76-
$_ -NotLike "*LanguageFeatures-Basic*" -AND
77-
$_ -NotLike "*Package_for_ServicingStack*" -AND
78-
$_ -NotLike "*.NET*" -AND
79-
$_ -NotLike "*Store*" -AND
80-
$_ -NotLike "*VCLibs*" -AND
81-
$_ -NotLike "*AAD.BrokerPlugin",
82-
$_ -NotLike "*LockApp*" -AND
83-
$_ -NotLike "*Notepad*" -AND
84-
$_ -NotLike "*immersivecontrolpanel*" -AND
85-
$_ -NotLike "*ContentDeliveryManager*" -AND
86-
$_ -NotLike "*PinningConfirMationDialog*" -AND
87-
$_ -NotLike "*SecHealthUI*" -AND
88-
$_ -NotLike "*SecureAssessmentBrowser*" -AND
89-
$_ -NotLike "*PrintDialog*" -AND
90-
$_ -NotLike "*AssignedAccessLockApp*" -AND
91-
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
92-
$_ -NotLike "*Apprep.ChxApp*" -AND
93-
$_ -NotLike "*CBS*" -AND
94-
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
95-
$_ -NotLike "*PeopleExperienceHost*" -AND
96-
$_ -NotLike "*ParentalControls*" -AND
97-
$_ -NotLike "*Win32WebViewHost*" -AND
98-
$_ -NotLike "*InputApp*" -AND
99-
$_ -NotLike "*AccountsControl*" -AND
100-
$_ -NotLike "*AsyncTextService*" -AND
101-
$_ -NotLike "*CapturePicker*" -AND
102-
$_ -NotLike "*CredDialogHost*" -AND
103-
$_ -NotLike "*BioEnrollMent*" -AND
104-
$_ -NotLike "*ShellExperienceHost*" -AND
105-
$_ -NotLike "*DesktopAppInstaller*" -AND
106-
$_ -NotLike "*WebMediaExtensions*" -AND
107-
$_ -NotLike "*WMIC*" -AND
108-
$_ -NotLike "*UI.XaML*"
109-
}
110-
111-
foreach ($pkg in $pkglist)
78+
try
11279
{
113-
try {
114-
$status = "Removing $pkg"
115-
Write-Progress -Activity "Removing Apps" -Status $status -PercentComplete ($counter++/$pkglist.Count*100)
116-
Remove-WindowsPackage -Path "$scratchDir" -PackageName $pkg -NoRestart -ErrorAction SilentlyContinue
117-
}
118-
catch {
119-
# This can happen if the package that is being removed is a permanent one, like FodMetadata
120-
Write-Host "Could not remove OS package $($pkg)"
121-
continue
80+
$pkglist = (Get-WindowsPackage -Path "$scratchDir").PackageName
81+
82+
$pkglist = $pkglist | Where-Object {
83+
$_ -NotLike "*ApplicationModel*" -AND
84+
$_ -NotLike "*indows-Client-LanguagePack*" -AND
85+
$_ -NotLike "*LanguageFeatures-Basic*" -AND
86+
$_ -NotLike "*Package_for_ServicingStack*" -AND
87+
$_ -NotLike "*.NET*" -AND
88+
$_ -NotLike "*Store*" -AND
89+
$_ -NotLike "*VCLibs*" -AND
90+
$_ -NotLike "*AAD.BrokerPlugin",
91+
$_ -NotLike "*LockApp*" -AND
92+
$_ -NotLike "*Notepad*" -AND
93+
$_ -NotLike "*immersivecontrolpanel*" -AND
94+
$_ -NotLike "*ContentDeliveryManager*" -AND
95+
$_ -NotLike "*PinningConfirMationDialog*" -AND
96+
$_ -NotLike "*SecHealthUI*" -AND
97+
$_ -NotLike "*SecureAssessmentBrowser*" -AND
98+
$_ -NotLike "*PrintDialog*" -AND
99+
$_ -NotLike "*AssignedAccessLockApp*" -AND
100+
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
101+
$_ -NotLike "*Apprep.ChxApp*" -AND
102+
$_ -NotLike "*CBS*" -AND
103+
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
104+
$_ -NotLike "*PeopleExperienceHost*" -AND
105+
$_ -NotLike "*ParentalControls*" -AND
106+
$_ -NotLike "*Win32WebViewHost*" -AND
107+
$_ -NotLike "*InputApp*" -AND
108+
$_ -NotLike "*AccountsControl*" -AND
109+
$_ -NotLike "*AsyncTextService*" -AND
110+
$_ -NotLike "*CapturePicker*" -AND
111+
$_ -NotLike "*CredDialogHost*" -AND
112+
$_ -NotLike "*BioEnrollMent*" -AND
113+
$_ -NotLike "*ShellExperienceHost*" -AND
114+
$_ -NotLike "*DesktopAppInstaller*" -AND
115+
$_ -NotLike "*WebMediaExtensions*" -AND
116+
$_ -NotLike "*WMIC*" -AND
117+
$_ -NotLike "*UI.XaML*"
118+
}
119+
120+
foreach ($pkg in $pkglist)
121+
{
122+
try {
123+
$status = "Removing $pkg"
124+
Write-Progress -Activity "Removing Apps" -Status $status -PercentComplete ($counter++/$pkglist.Count*100)
125+
Remove-WindowsPackage -Path "$scratchDir" -PackageName $pkg -NoRestart -ErrorAction SilentlyContinue
126+
}
127+
catch {
128+
# This can happen if the package that is being removed is a permanent one, like FodMetadata
129+
Write-Host "Could not remove OS package $($pkg)"
130+
continue
131+
}
122132
}
133+
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
134+
}
135+
catch
136+
{
137+
Write-Host "Unable to get information about the packages. MicroWin processing will continue, but packages will not be processed"
123138
}
124-
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
125139
}
126140

127141
function Remove-ProvisionedPackages([switch] $keepSecurity = $false)

winutil.ps1

+88-73
Original file line numberDiff line numberDiff line change
@@ -1189,90 +1189,104 @@ function Remove-Features([switch] $dumpFeatures = $false, [switch] $keepDefender
11891189
Remove-Features -keepDefender:$false
11901190

11911191
#>
1192-
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir).FeatureName
1193-
if ($dumpFeatures)
1192+
try
11941193
{
1195-
$featlist > allfeaturesdump.txt
1196-
}
1194+
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir).FeatureName
1195+
if ($dumpFeatures)
1196+
{
1197+
$featlist > allfeaturesdump.txt
1198+
}
11971199

1198-
$featlist = $featlist | Where-Object {
1199-
$_ -NotLike "*Printing*" -AND
1200-
$_ -NotLike "*TelnetClient*" -AND
1201-
$_ -NotLike "*PowerShell*" -AND
1202-
$_ -NotLike "*NetFx*" -AND
1203-
$_ -NotLike "*Media*" -AND
1204-
$_ -NotLike "*NFS*"
1205-
}
1200+
$featlist = $featlist | Where-Object {
1201+
$_ -NotLike "*Printing*" -AND
1202+
$_ -NotLike "*TelnetClient*" -AND
1203+
$_ -NotLike "*PowerShell*" -AND
1204+
$_ -NotLike "*NetFx*" -AND
1205+
$_ -NotLike "*Media*" -AND
1206+
$_ -NotLike "*NFS*"
1207+
}
12061208

1207-
if ($keepDefender) { $featlist = $featlist | Where-Object { $_ -NotLike "*Defender*" }}
1209+
if ($keepDefender) { $featlist = $featlist | Where-Object { $_ -NotLike "*Defender*" }}
12081210

1209-
foreach($feature in $featlist)
1211+
foreach($feature in $featlist)
1212+
{
1213+
$status = "Removing feature $feature"
1214+
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
1215+
Write-Debug "Removing feature $feature"
1216+
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $feature -Remove -ErrorAction SilentlyContinue -NoRestart
1217+
}
1218+
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
1219+
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
1220+
}
1221+
catch
12101222
{
1211-
$status = "Removing feature $feature"
1212-
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
1213-
Write-Debug "Removing feature $feature"
1214-
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $feature -Remove -ErrorAction SilentlyContinue -NoRestart
1223+
Write-Host "Unable to get information about the features. MicroWin processing will continue, but features will not be processed"
12151224
}
1216-
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
1217-
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
12181225
}
12191226

12201227
function Remove-Packages
12211228
{
1222-
$pkglist = (Get-WindowsPackage -Path "$scratchDir").PackageName
1223-
1224-
$pkglist = $pkglist | Where-Object {
1225-
$_ -NotLike "*ApplicationModel*" -AND
1226-
$_ -NotLike "*indows-Client-LanguagePack*" -AND
1227-
$_ -NotLike "*LanguageFeatures-Basic*" -AND
1228-
$_ -NotLike "*Package_for_ServicingStack*" -AND
1229-
$_ -NotLike "*.NET*" -AND
1230-
$_ -NotLike "*Store*" -AND
1231-
$_ -NotLike "*VCLibs*" -AND
1232-
$_ -NotLike "*AAD.BrokerPlugin",
1233-
$_ -NotLike "*LockApp*" -AND
1234-
$_ -NotLike "*Notepad*" -AND
1235-
$_ -NotLike "*immersivecontrolpanel*" -AND
1236-
$_ -NotLike "*ContentDeliveryManager*" -AND
1237-
$_ -NotLike "*PinningConfirMationDialog*" -AND
1238-
$_ -NotLike "*SecHealthUI*" -AND
1239-
$_ -NotLike "*SecureAssessmentBrowser*" -AND
1240-
$_ -NotLike "*PrintDialog*" -AND
1241-
$_ -NotLike "*AssignedAccessLockApp*" -AND
1242-
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
1243-
$_ -NotLike "*Apprep.ChxApp*" -AND
1244-
$_ -NotLike "*CBS*" -AND
1245-
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
1246-
$_ -NotLike "*PeopleExperienceHost*" -AND
1247-
$_ -NotLike "*ParentalControls*" -AND
1248-
$_ -NotLike "*Win32WebViewHost*" -AND
1249-
$_ -NotLike "*InputApp*" -AND
1250-
$_ -NotLike "*AccountsControl*" -AND
1251-
$_ -NotLike "*AsyncTextService*" -AND
1252-
$_ -NotLike "*CapturePicker*" -AND
1253-
$_ -NotLike "*CredDialogHost*" -AND
1254-
$_ -NotLike "*BioEnrollMent*" -AND
1255-
$_ -NotLike "*ShellExperienceHost*" -AND
1256-
$_ -NotLike "*DesktopAppInstaller*" -AND
1257-
$_ -NotLike "*WebMediaExtensions*" -AND
1258-
$_ -NotLike "*WMIC*" -AND
1259-
$_ -NotLike "*UI.XaML*"
1260-
}
1261-
1262-
foreach ($pkg in $pkglist)
1229+
try
12631230
{
1264-
try {
1265-
$status = "Removing $pkg"
1266-
Write-Progress -Activity "Removing Apps" -Status $status -PercentComplete ($counter++/$pkglist.Count*100)
1267-
Remove-WindowsPackage -Path "$scratchDir" -PackageName $pkg -NoRestart -ErrorAction SilentlyContinue
1268-
}
1269-
catch {
1270-
# This can happen if the package that is being removed is a permanent one, like FodMetadata
1271-
Write-Host "Could not remove OS package $($pkg)"
1272-
continue
1231+
$pkglist = (Get-WindowsPackage -Path "$scratchDir").PackageName
1232+
1233+
$pkglist = $pkglist | Where-Object {
1234+
$_ -NotLike "*ApplicationModel*" -AND
1235+
$_ -NotLike "*indows-Client-LanguagePack*" -AND
1236+
$_ -NotLike "*LanguageFeatures-Basic*" -AND
1237+
$_ -NotLike "*Package_for_ServicingStack*" -AND
1238+
$_ -NotLike "*.NET*" -AND
1239+
$_ -NotLike "*Store*" -AND
1240+
$_ -NotLike "*VCLibs*" -AND
1241+
$_ -NotLike "*AAD.BrokerPlugin",
1242+
$_ -NotLike "*LockApp*" -AND
1243+
$_ -NotLike "*Notepad*" -AND
1244+
$_ -NotLike "*immersivecontrolpanel*" -AND
1245+
$_ -NotLike "*ContentDeliveryManager*" -AND
1246+
$_ -NotLike "*PinningConfirMationDialog*" -AND
1247+
$_ -NotLike "*SecHealthUI*" -AND
1248+
$_ -NotLike "*SecureAssessmentBrowser*" -AND
1249+
$_ -NotLike "*PrintDialog*" -AND
1250+
$_ -NotLike "*AssignedAccessLockApp*" -AND
1251+
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
1252+
$_ -NotLike "*Apprep.ChxApp*" -AND
1253+
$_ -NotLike "*CBS*" -AND
1254+
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
1255+
$_ -NotLike "*PeopleExperienceHost*" -AND
1256+
$_ -NotLike "*ParentalControls*" -AND
1257+
$_ -NotLike "*Win32WebViewHost*" -AND
1258+
$_ -NotLike "*InputApp*" -AND
1259+
$_ -NotLike "*AccountsControl*" -AND
1260+
$_ -NotLike "*AsyncTextService*" -AND
1261+
$_ -NotLike "*CapturePicker*" -AND
1262+
$_ -NotLike "*CredDialogHost*" -AND
1263+
$_ -NotLike "*BioEnrollMent*" -AND
1264+
$_ -NotLike "*ShellExperienceHost*" -AND
1265+
$_ -NotLike "*DesktopAppInstaller*" -AND
1266+
$_ -NotLike "*WebMediaExtensions*" -AND
1267+
$_ -NotLike "*WMIC*" -AND
1268+
$_ -NotLike "*UI.XaML*"
1269+
}
1270+
1271+
foreach ($pkg in $pkglist)
1272+
{
1273+
try {
1274+
$status = "Removing $pkg"
1275+
Write-Progress -Activity "Removing Apps" -Status $status -PercentComplete ($counter++/$pkglist.Count*100)
1276+
Remove-WindowsPackage -Path "$scratchDir" -PackageName $pkg -NoRestart -ErrorAction SilentlyContinue
1277+
}
1278+
catch {
1279+
# This can happen if the package that is being removed is a permanent one, like FodMetadata
1280+
Write-Host "Could not remove OS package $($pkg)"
1281+
continue
1282+
}
12731283
}
1284+
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
1285+
}
1286+
catch
1287+
{
1288+
Write-Host "Unable to get information about the packages. MicroWin processing will continue, but packages will not be processed"
12741289
}
1275-
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
12761290
}
12771291

12781292
function Remove-ProvisionedPackages([switch] $keepSecurity = $false)
@@ -12369,7 +12383,7 @@ $sync.configs.tweaks = '{
1236912383
"panel": "1",
1237012384
"Order": "a040_",
1237112385
"Type": "Combobox",
12372-
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Level3 Open_DNS Quad9"
12386+
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Open_DNS Quad9 AdGuard_Ads_Trackers AdGuard_Ads_Trackers_Malware_Adult"
1237312387
},
1237412388
"WPFTweaksbutton": {
1237512389
"Content": "Run Tweaks",
@@ -14747,9 +14761,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
1474714761
<ComboBoxItem Content="Cloudflare" FontSize="{FontSize}"/>
1474814762
<ComboBoxItem Content="Cloudflare_Malware" FontSize="{FontSize}"/>
1474914763
<ComboBoxItem Content="Cloudflare_Malware_Adult" FontSize="{FontSize}"/>
14750-
<ComboBoxItem Content="Level3" FontSize="{FontSize}"/>
1475114764
<ComboBoxItem Content="Open_DNS" FontSize="{FontSize}"/>
1475214765
<ComboBoxItem Content="Quad9" FontSize="{FontSize}"/>
14766+
<ComboBoxItem Content="AdGuard_Ads_Trackers" FontSize="{FontSize}"/>
14767+
<ComboBoxItem Content="AdGuard_Ads_Trackers_Malware_Adult" FontSize="{FontSize}"/>
1475314768
</ComboBox>
1475414769
</StackPanel>
1475514770
<Button Name="WPFTweaksbutton" Content="Run Tweaks" HorizontalAlignment="Left" Margin="5" Padding="20,5" />

0 commit comments

Comments
 (0)