mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-02 02:53:31 -05:00
Test 10 2022 - The GUI Overhaul (#266)
* Create KnownIssues.md * Formatting and New Appx Function Fix formatting and added an appx function for grabbing and debloating Microsoft apps. There is also a program uninstall feature added for removing HP programs built in to new HP PCs. * Update README.md (#251) * Added Documentation from #159 * Cleanup and Program Adds * Trying Uniform Stretch * Initial GUI Revamp * Fall 2022 Program Additions Too many to list. * Added ToolTips to Tweaks * Change in App Removal * Update README.md * Add Reset News and Interest to Undo all * Add Wait-Process to Program Installs * Autologin Addition * Prep for main merge
This commit is contained in:
429
winutil.ps1
429
winutil.ps1
@ -34,7 +34,7 @@ catch {
|
||||
$xaml.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name) }
|
||||
|
||||
Function Get-FormVariables {
|
||||
If ($global:ReadmeDisplay -ne $true) { Write-host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow; $global:ReadmeDisplay = $true }
|
||||
#If ($global:ReadmeDisplay -ne $true) { Write-host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow; $global:ReadmeDisplay = $true }
|
||||
|
||||
|
||||
write-host ""
|
||||
@ -163,8 +163,11 @@ $WPFinstall.Add_Click({
|
||||
$wingetinstall.Add("GIMP.GIMP")
|
||||
$WPFInstallgimp.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallgithubdesktop.IsChecked -eq $true ) {
|
||||
If ( $WPFInstallgit.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Git.Git")
|
||||
$WPFInstallgithubdesktop.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallgithubdesktop.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("GitHub.GitHubDesktop")
|
||||
$WPFInstallgithubdesktop.IsChecked = $false
|
||||
}
|
||||
@ -454,7 +457,87 @@ $WPFinstall.Add_Click({
|
||||
$wingetinstall.Add("xanderfrangos.twinkletray")
|
||||
$WPFInstalltwinkletray.IsChecked = $false
|
||||
}
|
||||
|
||||
# Fall 2022 Additions
|
||||
If ( $WPFInstallshell.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Nilesoft.Shell")
|
||||
$WPFInstallshell.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallklite.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("CodecGuide.K-LiteCodecPack.Standard")
|
||||
$WPFInstallklite.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallsandboxie.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Sandboxie.Plus")
|
||||
$WPFInstallsandboxie.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallprocesslasso.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("BitSum.ProcessLasso")
|
||||
$WPFInstallprocesslasso.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallwinmerge.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("WinMerge.WinMerge")
|
||||
$WPFInstallwinmerge.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstalldotnet3.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Microsoft.DotNet.DesktopRuntime.3_1")
|
||||
$WPFInstalldotnet3.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstalldotnet5.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Microsoft.DotNet.DesktopRuntime.5")
|
||||
$WPFInstalldotnet5.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstalldotnet6.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Microsoft.DotNet.DesktopRuntime.6")
|
||||
$WPFInstalldotnet6.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallvc2015_64.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Microsoft.VC++2015-2022Redist-x64")
|
||||
$WPFInstallvc2015_64.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallvc2015_32.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Microsoft.VC++2015-2022Redist-x86")
|
||||
$WPFInstallvc2015_32.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallfoxpdf.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Foxit.PhantomPDF")
|
||||
$WPFInstallfoxpdf.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallonlyoffice.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("ONLYOFFICE.DesktopEditors")
|
||||
$WPFInstallonlyoffice.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallflux.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("flux.flux")
|
||||
$WPFInstallflux.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallitunes.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Apple.iTunes")
|
||||
$WPFInstallitunes.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallcider.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("CiderCollective.Cider")
|
||||
$WPFInstallcider.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstalljoplin.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Joplin.Joplin")
|
||||
$WPFInstalljoplin.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallopenoffice.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("Apache.OpenOffice")
|
||||
$WPFInstallopenoffice.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstallruskdesk.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("RustDesk.RustDesk")
|
||||
$WPFInstallruskdesk.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstalljami.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("SFLinux.Jami")
|
||||
$WPFInstalljami.IsChecked = $false
|
||||
}
|
||||
If ( $WPFInstalljdownloader.IsChecked -eq $true ) {
|
||||
$wingetinstall.Add("AppWork.JDownloader")
|
||||
$WPFInstalljdownloader.IsChecked = $false
|
||||
}
|
||||
# Check if winget is installed
|
||||
Write-Host "Checking if Winget is Installed..."
|
||||
if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
|
||||
@ -468,7 +551,7 @@ $WPFinstall.Add_Click({
|
||||
Write-Host "Running Alternative Installer for LTSC/Server Editions"
|
||||
|
||||
#Download Needed Files
|
||||
Write-Host "Downloading Needed Files..."
|
||||
Write-Host "Downloading Needed Files..."
|
||||
Start-BitsTransfer -Source "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" -Destination "$env:TEMP\Microsoft.VCLibs.x64.14.00.Desktop.appx"
|
||||
Start-BitsTransfer -Source "https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -Destination "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
|
||||
Start-BitsTransfer -Source "https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/b0a0692da1034339b76dce1c298a1e42_License1.xml" -Destination "$env:TEMP\b0a0692da1034339b76dce1c298a1e42_License1.xml"
|
||||
@ -518,6 +601,8 @@ $WPFinstall.Add_Click({
|
||||
try {
|
||||
Start-Process powershell.exe -Verb RunAs -ArgumentList "-command winget install -e --accept-source-agreements --accept-package-agreements --silent $node | Out-Host" -WindowStyle Normal
|
||||
$wingetResult.Add("$node`n")
|
||||
Start-Sleep -s 3
|
||||
Wait-Process winget -Timeout 90 -ErrorAction SilentlyContinue
|
||||
}
|
||||
catch [System.InvalidOperationException] {
|
||||
Write-Warning "Allow Yes on User Access Control to Install"
|
||||
@ -528,7 +613,7 @@ $WPFinstall.Add_Click({
|
||||
}
|
||||
$wingetResult.ToArray()
|
||||
$wingetResult | ForEach-Object { $_ } | Out-Host
|
||||
|
||||
|
||||
# Popup after finished
|
||||
$ButtonType = [System.Windows.MessageBoxButton]::OK
|
||||
if ($wingetResult -ne "") {
|
||||
@ -560,7 +645,7 @@ $WPFInstallUpgrade.Add_Click({
|
||||
Write-Error $_.Exception
|
||||
}
|
||||
$ButtonType = [System.Windows.MessageBoxButton]::OK
|
||||
$Messageboxbody = if($isUpgradeSuccess) {"Upgrade Done"} else {"Upgrade was not succesful"}
|
||||
$Messageboxbody = if ($isUpgradeSuccess) { "Upgrade Done" } else { "Upgrade was not succesful" }
|
||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||
|
||||
[System.Windows.MessageBox]::Show($Messageboxbody, $AppTitle, $ButtonType, $MessageIcon)
|
||||
@ -693,7 +778,7 @@ $WPFtweaksbutton.Add_Click({
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Type DWord -Value 0
|
||||
|
||||
#Disabling Gamebar Presence Writer, which causes stutter in games
|
||||
PowerRun.exe /SW:0 Powershell.exe -command {Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 0}
|
||||
PowerRun.exe /SW:0 Powershell.exe -command { Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 0 }
|
||||
|
||||
$WPFEssTweaksDVR.IsChecked = $false
|
||||
}
|
||||
@ -723,7 +808,7 @@ $WPFtweaksbutton.Add_Click({
|
||||
}
|
||||
If ( $WPFMiscTweaksDisableTPMCheck.IsChecked -eq $true ) {
|
||||
Write-Host "Disabling TPM Check..."
|
||||
If (!(Test-Path "HKLM:\SYSTEM\Setup\MoSetup")) {
|
||||
If (!(Test-Path "HKLM:\SYSTEM\Setup\MoSetup")) {
|
||||
New-Item -Path "HKLM:\SYSTEM\Setup\MoSetup" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\Setup\MoSetup" -Name "AllowUpgradesWithUnsupportedTPM" -Type DWord -Value 1
|
||||
@ -799,7 +884,7 @@ $WPFtweaksbutton.Add_Click({
|
||||
#"FrameServer" # Windows Camera Frame Server (Allows multiple clients to access video frames from camera devices)
|
||||
"gupdate" # Google Update
|
||||
"gupdatem" # Another Google Update Service
|
||||
"iphlpsvc" # ipv6(Most websites use ipv4 instead)
|
||||
#"iphlpsvc" # ipv6(Most websites use ipv4 instead) - Needed for Xbox Live
|
||||
"lfsvc" # Geolocation Service
|
||||
#"LicenseManager" # Disable LicenseManager (Windows Store may not work properly)
|
||||
"lmhosts" # TCP/IP NetBIOS Helper
|
||||
@ -1031,6 +1116,11 @@ $WPFtweaksbutton.Add_Click({
|
||||
Write-Host "Stopping and disabling Diagnostics Tracking Service..."
|
||||
Stop-Service "DiagTrack"
|
||||
Set-Service "DiagTrack" -StartupType Disabled
|
||||
Write-Host "Doing Security checks for Administrator Account and Group Policy"
|
||||
if (($(Get-WMIObject -class Win32_ComputerSystem | Select-Object username).username).IndexOf('Administrator') -eq -1) {
|
||||
net user administrator /active:no
|
||||
}
|
||||
|
||||
$WPFEssTweaksTele.IsChecked = $false
|
||||
}
|
||||
If ( $WPFEssTweaksWifi.IsChecked -eq $true ) {
|
||||
@ -1113,117 +1203,176 @@ $WPFtweaksbutton.Add_Click({
|
||||
If ( $WPFEssTweaksDeBloat.IsChecked -eq $true ) {
|
||||
$Bloatware = @(
|
||||
#Unnecessary Windows 10 AppX Apps
|
||||
"Microsoft.3DBuilder"
|
||||
"Microsoft.Microsoft3DViewer"
|
||||
"Microsoft.AppConnector"
|
||||
"Microsoft.BingFinance"
|
||||
"Microsoft.BingNews"
|
||||
"Microsoft.BingSports"
|
||||
"Microsoft.BingTranslator"
|
||||
"Microsoft.BingWeather"
|
||||
"Microsoft.BingFoodAndDrink"
|
||||
"Microsoft.BingHealthAndFitness"
|
||||
"Microsoft.BingTravel"
|
||||
"Microsoft.MinecraftUWP"
|
||||
"Microsoft.GamingServices"
|
||||
# "Microsoft.WindowsReadingList"
|
||||
"Microsoft.GetHelp"
|
||||
"Microsoft.Getstarted"
|
||||
"Microsoft.Messaging"
|
||||
"Microsoft.Microsoft3DViewer"
|
||||
"Microsoft.MicrosoftSolitaireCollection"
|
||||
"Microsoft.NetworkSpeedTest"
|
||||
"Microsoft.News"
|
||||
"Microsoft.Office.Lens"
|
||||
"Microsoft.Office.Sway"
|
||||
"Microsoft.Office.OneNote"
|
||||
"Microsoft.OneConnect"
|
||||
"Microsoft.People"
|
||||
"Microsoft.Print3D"
|
||||
"Microsoft.SkypeApp"
|
||||
"Microsoft.Wallet"
|
||||
"Microsoft.Whiteboard"
|
||||
"Microsoft.WindowsAlarms"
|
||||
"microsoft.windowscommunicationsapps"
|
||||
"Microsoft.WindowsFeedbackHub"
|
||||
"Microsoft.WindowsMaps"
|
||||
"Microsoft.WindowsPhone"
|
||||
"Microsoft.WindowsSoundRecorder"
|
||||
"Microsoft.XboxApp"
|
||||
"Microsoft.ConnectivityStore"
|
||||
"Microsoft.CommsPhone"
|
||||
"Microsoft.ScreenSketch"
|
||||
"Microsoft.Xbox.TCUI"
|
||||
"Microsoft.XboxGameOverlay"
|
||||
"Microsoft.XboxGameCallableUI"
|
||||
"Microsoft.XboxSpeechToTextOverlay"
|
||||
"Microsoft.MixedReality.Portal"
|
||||
"Microsoft.ZuneMusic"
|
||||
"Microsoft.ZuneVideo"
|
||||
#"Microsoft.YourPhone"
|
||||
"Microsoft.Getstarted"
|
||||
"Microsoft.MicrosoftOfficeHub"
|
||||
"3DBuilder"
|
||||
"Microsoft3DViewer"
|
||||
"AppConnector"
|
||||
"BingFinance"
|
||||
"BingNews"
|
||||
"BingSports"
|
||||
"BingTranslator"
|
||||
"BingWeather"
|
||||
"BingFoodAndDrink"
|
||||
"BingHealthAndFitness"
|
||||
"BingTravel"
|
||||
"MinecraftUWP"
|
||||
"GamingServices"
|
||||
# "WindowsReadingList"
|
||||
"GetHelp"
|
||||
"Getstarted"
|
||||
"Messaging"
|
||||
"Microsoft3DViewer"
|
||||
"MicrosoftSolitaireCollection"
|
||||
"NetworkSpeedTest"
|
||||
"News"
|
||||
"Lens"
|
||||
"Sway"
|
||||
"OneNote"
|
||||
"OneConnect"
|
||||
"People"
|
||||
"Print3D"
|
||||
"SkypeApp"
|
||||
"Todos"
|
||||
"Wallet"
|
||||
"Whiteboard"
|
||||
"WindowsAlarms"
|
||||
"windowscommunicationsapps"
|
||||
"WindowsFeedbackHub"
|
||||
"WindowsMaps"
|
||||
"WindowsPhone"
|
||||
"WindowsSoundRecorder"
|
||||
"XboxApp"
|
||||
"ConnectivityStore"
|
||||
"CommsPhone"
|
||||
"ScreenSketch"
|
||||
"TCUI"
|
||||
"XboxGameOverlay"
|
||||
"XboxGameCallableUI"
|
||||
"XboxSpeechToTextOverlay"
|
||||
"MixedReality.Portal"
|
||||
"ZuneMusic"
|
||||
"ZuneVideo"
|
||||
#"YourPhone"
|
||||
"Getstarted"
|
||||
"MicrosoftOfficeHub"
|
||||
|
||||
#Sponsored Windows 10 AppX Apps
|
||||
#Add sponsored/featured apps to remove in the "*AppName*" format
|
||||
"*EclipseManager*"
|
||||
"*ActiproSoftwareLLC*"
|
||||
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
|
||||
"*Duolingo-LearnLanguagesforFree*"
|
||||
"*PandoraMediaInc*"
|
||||
"*CandyCrush*"
|
||||
"*BubbleWitch3Saga*"
|
||||
"*Wunderlist*"
|
||||
"*Flipboard*"
|
||||
"*Twitter*"
|
||||
"*Facebook*"
|
||||
"*Royal Revolt*"
|
||||
"*Sway*"
|
||||
"*Speed Test*"
|
||||
"*Dolby*"
|
||||
"*Viber*"
|
||||
"*ACGMediaPlayer*"
|
||||
"*Netflix*"
|
||||
"*OneCalendar*"
|
||||
"*LinkedInforWindows*"
|
||||
"*HiddenCityMysteryofShadows*"
|
||||
"*Hulu*"
|
||||
"*HiddenCity*"
|
||||
"*AdobePhotoshopExpress*"
|
||||
"*HotspotShieldFreeVPN*"
|
||||
"EclipseManager"
|
||||
"ActiproSoftwareLLC"
|
||||
"AdobeSystemsIncorporated.AdobePhotoshopExpress"
|
||||
"Duolingo-LearnLanguagesforFree"
|
||||
"PandoraMediaInc"
|
||||
"CandyCrush"
|
||||
"BubbleWitch3Saga"
|
||||
"Wunderlist"
|
||||
"Flipboard"
|
||||
"Twitter"
|
||||
"Facebook"
|
||||
"Royal Revolt"
|
||||
"Sway"
|
||||
"Speed Test"
|
||||
"Dolby"
|
||||
"Viber"
|
||||
"ACGMediaPlayer"
|
||||
"Netflix"
|
||||
"OneCalendar"
|
||||
"LinkedInforWindows"
|
||||
"HiddenCityMysteryofShadows"
|
||||
"Hulu"
|
||||
"HiddenCity"
|
||||
"AdobePhotoshopExpress"
|
||||
"HotspotShieldFreeVPN"
|
||||
|
||||
#Optional: Typically not removed but you can if you need to
|
||||
"*Microsoft.Advertising.Xaml*"
|
||||
#"*Microsoft.MSPaint*"
|
||||
#"*Microsoft.MicrosoftStickyNotes*"
|
||||
#"*Microsoft.Windows.Photos*"
|
||||
#"*Microsoft.WindowsCalculator*"
|
||||
#"*Microsoft.WindowsStore*"
|
||||
"Advertising"
|
||||
#"MSPaint"
|
||||
#"MicrosoftStickyNotes"
|
||||
#"Windows.Photos"
|
||||
#"WindowsCalculator"
|
||||
#"WindowsStore"
|
||||
|
||||
# HPBloatware Packages
|
||||
"HPJumpStarts"
|
||||
"HPPCHardwareDiagnosticsWindows"
|
||||
"HPPowerManager"
|
||||
"HPPrivacySettings"
|
||||
"HPSupportAssistant"
|
||||
"HPSureShieldAI"
|
||||
"HPSystemInformation"
|
||||
"HPQuickDrop"
|
||||
"HPWorkWell"
|
||||
"myHP"
|
||||
"HPDesktopSupportUtilities"
|
||||
"HPQuickTouch"
|
||||
"HPEasyClean"
|
||||
"HPSystemInformation"
|
||||
)
|
||||
|
||||
## Teams Removal
|
||||
# Remove Teams Machine-Wide Installer
|
||||
Write-Host "Removing Teams Machine-wide Installer" -ForegroundColor Yellow
|
||||
$MachineWide = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "Teams Machine-Wide Installer" }
|
||||
$MachineWide.Uninstall()
|
||||
# Remove Teams for Current Users
|
||||
$localAppData = "$($env:LOCALAPPDATA)\Microsoft\Teams"
|
||||
$programData = "$($env:ProgramData)\$($env:USERNAME)\Microsoft\Teams"
|
||||
If (Test-Path "$($localAppData)\Current\Teams.exe") {
|
||||
unInstallTeams($localAppData)
|
||||
}
|
||||
elseif (Test-Path "$($programData)\Current\Teams.exe") {
|
||||
unInstallTeams($programData)
|
||||
}
|
||||
else {
|
||||
Write-Warning "Teams installation not found"
|
||||
}
|
||||
# Get all Users
|
||||
$Users = Get-ChildItem -Path "$($ENV:SystemDrive)\Users"
|
||||
# Process all the Users
|
||||
$Users | ForEach-Object {
|
||||
Write-Host "Process user: $($_.Name)" -ForegroundColor Yellow
|
||||
#Locate installation folder
|
||||
$localAppData = "$($ENV:SystemDrive)\Users\$($_.Name)\AppData\Local\Microsoft\Teams"
|
||||
$programData = "$($env:ProgramData)\$($_.Name)\Microsoft\Teams"
|
||||
If (Test-Path "$($localAppData)\Current\Teams.exe") {
|
||||
unInstallTeams($localAppData)
|
||||
}
|
||||
elseif (Test-Path "$($programData)\Current\Teams.exe") {
|
||||
unInstallTeams($programData)
|
||||
}
|
||||
else {
|
||||
Write-Warning "Teams installation not found for user $($_.Name)"
|
||||
}
|
||||
}
|
||||
cmd /c winget uninstall -h "Microsoft Teams"
|
||||
|
||||
Write-Host "Removing Bloatware"
|
||||
|
||||
foreach ($Bloat in $Bloatware) {
|
||||
Get-AppxPackage -Name $Bloat | Remove-AppxPackage
|
||||
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
|
||||
Get-AppxPackage "*$Bloat*" | Remove-AppxPackage
|
||||
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Bloat*" | Remove-AppxProvisionedPackage -Online
|
||||
Write-Host "Trying to remove $Bloat."
|
||||
}
|
||||
|
||||
Write-Host "Finished Removing Bloatware Apps"
|
||||
Write-Host "Removing Bloatware Programs"
|
||||
# Remove installed programs
|
||||
$InstalledPrograms = Get-Package | Where-Object { $UninstallPrograms -contains $_.Name }
|
||||
$InstalledPrograms | ForEach-Object {
|
||||
|
||||
Write-Host -Object "Attempting to uninstall: [$($_.Name)]..."
|
||||
|
||||
Try {
|
||||
$Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction Stop
|
||||
Write-Host -Object "Successfully uninstalled: [$($_.Name)]"
|
||||
}
|
||||
Catch {
|
||||
Write-Warning -Message "Failed to uninstall: [$($_.Name)]"
|
||||
}
|
||||
}
|
||||
Write-Host "Finished Removing Bloatware Programs"
|
||||
$WPFEssTweaksDeBloat.IsChecked = $false
|
||||
}
|
||||
Write-Host "Doing Security checks for Administrator Account and Group Policy"
|
||||
if(($(Get-WMIObject -class Win32_ComputerSystem | Select-Object username).username).IndexOf('Administrator') -eq -1){
|
||||
net user administrator /active:no
|
||||
}
|
||||
|
||||
if(!(((Get-ComputerInfo).WindowsEditionId).IndexOf('Core') -eq -1) -or !(((Get-ComputerInfo).WindowsEditionId).IndexOf('Home') -eq -1)){ # Not sure if home edition is Core or Home
|
||||
Write-Host "Enabling gpedit.msc...Group Policy for Home Users"
|
||||
Get-ChildItem @(
|
||||
"$env:SystemDrive\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum",
|
||||
"$env:SystemDrive\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum"
|
||||
) | ForEach-Object { dism.exe /online /norestart /add-package:"$_" }
|
||||
}
|
||||
|
||||
Write-Host "================================="
|
||||
Write-Host "-- Tweaks are Finished ---"
|
||||
Write-Host "================================="
|
||||
@ -1237,18 +1386,18 @@ $WPFtweaksbutton.Add_Click({
|
||||
})
|
||||
|
||||
$WPFEnableDarkMode.Add_Click({
|
||||
Write-Host "Enabling Dark Mode"
|
||||
$Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||
Set-ItemProperty $Theme AppsUseLightTheme -Value 0
|
||||
Write-Host "Enabled"
|
||||
Write-Host "Enabling Dark Mode"
|
||||
$Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||
Set-ItemProperty $Theme AppsUseLightTheme -Value 0
|
||||
Write-Host "Enabled"
|
||||
}
|
||||
)
|
||||
|
||||
$WPFDisableDarkMode.Add_Click({
|
||||
Write-Host "Disabling Dark Mode"
|
||||
$Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||
Set-ItemProperty $Theme AppsUseLightTheme -Value 1
|
||||
Write-Host "Disabled"
|
||||
Write-Host "Disabling Dark Mode"
|
||||
$Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||
Set-ItemProperty $Theme AppsUseLightTheme -Value 1
|
||||
Write-Host "Disabled"
|
||||
}
|
||||
)
|
||||
#===========================================================================
|
||||
@ -1384,10 +1533,15 @@ $WPFundoall.Add_Click({
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
|
||||
Write-Host "Restoring Default Right Click Menu Layout"
|
||||
Remove-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Recurse -Confirm:$false -Force
|
||||
|
||||
Write-Host "Reset News and Interests"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 1
|
||||
# Remove "News and Interest" from taskbar
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 0
|
||||
Write-Host "Done - Reverted to Stock Settings"
|
||||
|
||||
#Enable Gamebar Presence Writer
|
||||
PowerRun.exe /SW:0 Powershell.exe -command {Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 1}
|
||||
PowerRun.exe /SW:0 Powershell.exe -command { Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 1 }
|
||||
|
||||
Write-Host "Essential Undo Completed"
|
||||
|
||||
@ -1464,7 +1618,10 @@ $WPFPanelDISM.Add_Click({
|
||||
Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
|
||||
Read-Host '`nPress Enter to Continue'" -verb runas
|
||||
})
|
||||
|
||||
$WPFPanelAutologin.Add_Click({
|
||||
curl.exe -ss "https://live.sysinternals.com/Autologon.exe" -o autologin.exe # Official Microsoft recommendation https://learn.microsoft.com/en-us/sysinternals/downloads/autologon
|
||||
cmd /c autologin.exe
|
||||
})
|
||||
$WPFPanelcontrol.Add_Click({
|
||||
cmd /c control
|
||||
})
|
||||
@ -1632,31 +1789,31 @@ $WPFFixesUpdate.Add_Click({
|
||||
})
|
||||
|
||||
$WPFUpdatesdisable.Add_Click({
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
|
||||
|
||||
$services = @(
|
||||
"BITS"
|
||||
"wuauserv"
|
||||
)
|
||||
$services = @(
|
||||
"BITS"
|
||||
"wuauserv"
|
||||
)
|
||||
|
||||
foreach ($service in $services) {
|
||||
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
|
||||
foreach ($service in $services) {
|
||||
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
|
||||
|
||||
Write-Host "Setting $service StartupType to Disabled"
|
||||
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
|
||||
}
|
||||
Write-Host "================================="
|
||||
Write-Host "--- Updates ARE DISABLED ---"
|
||||
Write-Host "================================="
|
||||
})
|
||||
Write-Host "Setting $service StartupType to Disabled"
|
||||
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
|
||||
}
|
||||
Write-Host "================================="
|
||||
Write-Host "--- Updates ARE DISABLED ---"
|
||||
Write-Host "================================="
|
||||
})
|
||||
$WPFUpdatessecurity.Add_Click({
|
||||
Write-Host "Disabling driver offering through Windows Update..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
|
||||
|
Reference in New Issue
Block a user