diff --git a/README.md b/README.md index 21c1908..33f8aa7 100644 --- a/README.md +++ b/README.md @@ -180,8 +180,8 @@ _This section contains options to restore the system apps, by downloading them f _This section contains tools to solve some Windows problems and get info about how much debloated the system is._ - [`Randomize System Color`](./src/scripts/other-scripts/New-SystemColor.ps1): Changes the Windows color pallette to a random generated hex color; -- [`Reinstall Pre-Installed Apps`](./src/scripts/Install-PreInstalledApps.ps1): Rebloat Windows with all the Pre-Installed Apps; -- [`Repair Windows`](./src/scripts/Repair-Windows.ps1): Try to Completely fix the Windows worst problems via Command Line; +- [`Reinstall Pre-Installed Apps`](./src/scripts/Install-DefaultAppsList.ps1): Rebloat Windows with all the Pre-Installed Apps; +- [`Repair Windows`](./src/scripts/Repair-WindowsSystem.ps1): Try to Completely fix the Windows worst problems via Command Line; - [`Show Debloat Info`](./src/scripts/other-scripts/Show-DebloatInfo.ps1): Make an overall check-up from disabled and enabled Windows Components (Compare before and after applying tweaks, it's a great difference); #### Windows Update ([Can be found here](src/utils/Individual-Tweaks.psm1)) diff --git a/WinDebloatTools.ps1 b/WinDebloatTools.ps1 index 2e28aff..f402539 100644 --- a/WinDebloatTools.ps1 +++ b/WinDebloatTools.ps1 @@ -81,11 +81,11 @@ function Open-DebloatScript { "Optimize-TaskScheduler.ps1", "Optimize-ServicesRunning.ps1", "Remove-BloatwareAppsList.ps1", - "Remove-CapabilitiesList.ps1", "Optimize-Privacy.ps1", "Optimize-Performance.ps1", "Register-PersonalTweaksList.ps1", "Optimize-Security.ps1", + "Remove-CapabilitiesList.ps1", "Optimize-WindowsFeaturesList.ps1" ) @@ -115,7 +115,7 @@ function Show-GUI() { # <===== Specific Layout =====> - $LayoutT1 = New-LayoutPage -NumOfPanels 3 -PanelHeight 960 + $LayoutT1 = New-LayoutPage -NumOfPanels 3 -PanelHeight 985 $LayoutT2 = New-LayoutPage -NumOfPanels 4 -PanelHeight 1785 # <===== UI =====> @@ -174,7 +174,8 @@ function Show-GUI() { $InstallOneDrive = New-Button -Text "OneDrive" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallMicrosoftEdge -MarginTop $LayoutT1.DistanceBetweenElements $InstallPaintPaint3D = New-Button -Text "Paint + Paint 3D" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallOneDrive -MarginTop $LayoutT1.DistanceBetweenElements $InstallPhoneLink = New-Button -Text "Phone Link" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallPaintPaint3D -MarginTop $LayoutT1.DistanceBetweenElements - $InstallSoundRecorder = New-Button -Text "Sound Recorder" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallPhoneLink -MarginTop $LayoutT1.DistanceBetweenElements + $InstallQuickAssist = New-Button -Text "Quick Assist" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallPhoneLink -MarginTop $LayoutT1.DistanceBetweenElements + $InstallSoundRecorder = New-Button -Text "Sound Recorder" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallQuickAssist -MarginTop $LayoutT1.DistanceBetweenElements $InstallTaskbarWidgets = New-Button -Text "Taskbar Widgets" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallSoundRecorder -MarginTop $LayoutT1.DistanceBetweenElements $InstallUWPWMediaPlayer = New-Button -Text "Windows Media Player (UWP)" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallTaskbarWidgets -MarginTop $LayoutT1.DistanceBetweenElements $InstallXbox = New-Button -Text "Xbox" -Width $LayoutT1.PanelElementWidth -Height $LayoutT1.ButtonHeight -LocationX $LayoutT1.PanelElementX -FontSize $LayoutT1.Heading[3] -ElementBefore $InstallUWPWMediaPlayer -MarginTop $LayoutT1.DistanceBetweenElements @@ -421,7 +422,7 @@ function Show-GUI() { # Add Elements to each Tab Panel $T1Panel1.Controls.AddRange(@($ClCustomizeFeatures, $CbDarkTheme, $CbActivityHistory, $CbBackgroundsApps, $CbClipboardHistory, $CbClipboardSyncAcrossDevice, $CbCortana, $CbHibernate, $CbOldVolumeControl, $CbOnlineSpeechRecognition, $CbPhoneLink, $CbPhotoViewer, $CbSearchAppForUnknownExt, $CbTelemetry, $CbWSearchService, $CbXboxGameBarDVRandMode)) $T1Panel2.Controls.AddRange(@($ClDebloatTools, $ApplyTweaks, $UndoTweaks, $RemoveMSEdge, $RemoveOneDrive, $RemoveXbox, $PictureBox1)) - $T1Panel2.Controls.AddRange(@($ClInstallSystemApps, $InstallCortana, $InstallDolbyAudio, $InstallMicrosoftEdge, $InstallOneDrive, $InstallPaintPaint3D, $InstallPhoneLink, $InstallSoundRecorder, $InstallTaskbarWidgets, $InstallUWPWMediaPlayer, $InstallXbox)) + $T1Panel2.Controls.AddRange(@($ClInstallSystemApps, $InstallCortana, $InstallDolbyAudio, $InstallMicrosoftEdge, $InstallOneDrive, $InstallPaintPaint3D, $InstallPhoneLink, $InstallQuickAssist, $InstallSoundRecorder, $InstallTaskbarWidgets, $InstallUWPWMediaPlayer, $InstallXbox)) $T1Panel2.Controls.AddRange(@($ClOtherTools, $RandomizeSystemColor, $ReinstallBloatApps, $RepairWindows, $ShowDebloatInfo)) $T1Panel3.Controls.AddRange(@($ClWindowsUpdate, $CbAutomaticWindowsUpdate)) $T1Panel3.Controls.AddRange(@($ClOptionalFeatures, $CbInternetExplorer, $CbPrintToPDFServices, $CbPrintingXPSServices, $CbWindowsMediaPlayer)) @@ -473,12 +474,12 @@ function Show-GUI() { "Use-DebloatSoftware.ps1", "Optimize-TaskScheduler.ps1", "Optimize-ServicesRunning.ps1", - "Remove-CapabilitiesList.ps1", "Optimize-Privacy.ps1", "Optimize-Performance.ps1", "Register-PersonalTweaksList.ps1", + "Remove-CapabilitiesList.ps1", "Optimize-WindowsFeaturesList.ps1", - "Install-PreInstalledApps.ps1" + "Install-DefaultAppsList.ps1" ) Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts $Scripts -DoneTitle $DoneTitle -DoneMessage $DoneMessage Set-RevertStatus -Revert $false @@ -504,7 +505,7 @@ function Show-GUI() { }) $RepairWindows.Add_Click( { - Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts @("Backup-System.ps1", "Repair-Windows.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage + Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts @("Backup-System.ps1", "Repair-WindowsSystem.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage }) $InstallCortana.Add_Click( { @@ -531,6 +532,10 @@ function Show-GUI() { Install-PhoneLink }) + $InstallQuickAssist.Add_Click( { + Install-QuickAssist + }) + $InstallSoundRecorder.Add_Click( { Install-SoundRecorder }) @@ -552,7 +557,7 @@ function Show-GUI() { }) $ReinstallBloatApps.Add_Click( { - Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts @("Install-PreInstalledApps.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage + Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts @("Install-DefaultAppsList.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage }) $ShowDebloatInfo.Add_Click( { diff --git a/src/lib/install-font.psm1 b/src/lib/Install-Font.psm1 similarity index 100% rename from src/lib/install-font.psm1 rename to src/lib/Install-Font.psm1 diff --git a/src/lib/manage-software.psm1 b/src/lib/Manage-Software.psm1 similarity index 100% rename from src/lib/manage-software.psm1 rename to src/lib/Manage-Software.psm1 diff --git a/src/lib/new-shortcut.psm1 b/src/lib/New-Shortcut.psm1 similarity index 100% rename from src/lib/new-shortcut.psm1 rename to src/lib/New-Shortcut.psm1 diff --git a/src/lib/open-file.psm1 b/src/lib/Open-File.psm1 similarity index 100% rename from src/lib/open-file.psm1 rename to src/lib/Open-File.psm1 diff --git a/src/lib/start-logging.psm1 b/src/lib/Start-Logging.psm1 similarity index 100% rename from src/lib/start-logging.psm1 rename to src/lib/Start-Logging.psm1 diff --git a/src/lib/title-templates.psm1 b/src/lib/Title-Templates.psm1 similarity index 100% rename from src/lib/title-templates.psm1 rename to src/lib/Title-Templates.psm1 diff --git a/src/lib/ui/ui-helper.psm1 b/src/lib/ui/Ui-Helper.psm1 similarity index 100% rename from src/lib/ui/ui-helper.psm1 rename to src/lib/ui/Ui-Helper.psm1 diff --git a/src/scripts/backup-system.ps1 b/src/scripts/Backup-System.ps1 similarity index 79% rename from src/scripts/backup-system.ps1 rename to src/scripts/Backup-System.ps1 index 6ef8fcc..80a6aa8 100644 --- a/src/scripts/backup-system.ps1 +++ b/src/scripts/Backup-System.ps1 @@ -1,5 +1,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Title-Templates.psm1" +$Script:TweakType = "Backup" + function New-RestorePoint() { Write-Status -Types "+", $TweakType -Status "Enabling system drive Restore Point..." Enable-ComputerRestore -Drive "$env:SystemDrive\" @@ -25,10 +27,5 @@ function Backup-HostsFile() { Pop-Location } -function Main() { - $Script:TweakType = "Backup" - New-RestorePoint # This makes a restoration point before the script begins - Backup-HostsFile # Backup the Hosts file found on "X:\Windows\System32\drivers\etc" of the current system -} - -Main +New-RestorePoint # This makes a restoration point before the script begins +Backup-HostsFile # Backup the Hosts file found on "X:\Windows\System32\drivers\etc" of the current system diff --git a/src/scripts/Install-PreInstalledApps.ps1 b/src/scripts/Install-DefaultAppsList.ps1 similarity index 95% rename from src/scripts/Install-PreInstalledApps.ps1 rename to src/scripts/Install-DefaultAppsList.ps1 index 3a481e8..496d615 100644 --- a/src/scripts/Install-PreInstalledApps.ps1 +++ b/src/scripts/Install-DefaultAppsList.ps1 @@ -1,4 +1,4 @@ -function Install-PreInstalledApps() { +function Install-DefaultAppsList() { # The following code is from Microsoft (Adapted): https://go.microsoft.com/fwlink/?LinkId=619547 # Get all the provisioned packages $Packages = (Get-Item 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications') | Get-ChildItem @@ -28,4 +28,4 @@ function Install-PreInstalledApps() { } } -Install-PreInstalledApps +Install-DefaultAppsList diff --git a/src/scripts/Install-PackageManager.ps1 b/src/scripts/Install-PackageManager.ps1 index ec7494e..b496922 100644 --- a/src/scripts/Install-PackageManager.ps1 +++ b/src/scripts/Install-PackageManager.ps1 @@ -93,88 +93,85 @@ function Install-WingetDependency() { Return $false } -function Main() { - $WingetParams = @{ - Name = "Winget" - CheckExistenceBlock = { winget --version } - InstallCommandBlock = - { - New-Item -Path "$(Get-TempScriptFolder)\downloads\" -Name "winget-install" -ItemType Directory -Force | Out-Null - Push-Location -Path "$(Get-TempScriptFolder)\downloads\winget-install\" - Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted - Install-Script -Name winget-install -Force - winget-install.ps1 - Pop-Location - Remove-Item -Path "$(Get-TempScriptFolder)\downloads\winget-install\" - } - Time = "12:00" - UpdateScriptBlock = - { - Remove-Item -Path "$env:TEMP\Win-Debloat-Tools\logs\*" -Include "WingetDailyUpgrade_*.log" - Start-Transcript -Path "$env:TEMP\Win-Debloat-Tools\logs\WingetDailyUpgrade_$(Get-Date -Format "yyyy-MM-dd_HH-mm-ss").log" - Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force # Only needed to run Winget - winget source update --disable-interactivity | Out-Host - winget upgrade --all --silent | Out-Host - Stop-Transcript - } +$WingetParams = @{ + Name = "Winget" + CheckExistenceBlock = { winget --version } + InstallCommandBlock = + { + New-Item -Path "$(Get-TempScriptFolder)\downloads\" -Name "winget-install" -ItemType Directory -Force | Out-Null + Push-Location -Path "$(Get-TempScriptFolder)\downloads\winget-install\" + Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted + Install-Script -Name winget-install -Force + winget-install.ps1 + Pop-Location + Remove-Item -Path "$(Get-TempScriptFolder)\downloads\winget-install\" } + Time = "12:00" + UpdateScriptBlock = + { + Remove-Item -Path "$env:TEMP\Win-Debloat-Tools\logs\*" -Include "WingetDailyUpgrade_*.log" + Start-Transcript -Path "$env:TEMP\Win-Debloat-Tools\logs\WingetDailyUpgrade_$(Get-Date -Format "yyyy-MM-dd_HH-mm-ss").log" + Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force # Only needed to run Winget + winget source update --disable-interactivity | Out-Host + winget upgrade --all --silent | Out-Host + Stop-Transcript + } +} - $WingetParams2 = @{ - Name = "Winget (Method 2)" - CheckExistenceBlock = { winget --version } - InstallCommandBlock = - { - $WingetDepOutput = Install-WingetDependency - $WingetOutput = Get-APIFile -URI "https://api.github.com/repos/microsoft/winget-cli/releases/latest" -ObjectProperty "assets" -FileNameLike "*.msixbundle" -PropertyValue "browser_download_url" -OutputFile "Microsoft.DesktopAppInstaller.msixbundle" - $AppName = Split-Path -Path $WingetOutput -Leaf - - Try { - # Method from: https://github.com/microsoft/winget-cli/blob/master/doc/troubleshooting/README.md#machine-wide-provisioning - If ($WingetDepOutput) { - Write-Status -Types "@" -Status "Trying to install the App (w/ dependency): $AppName" -Warning - $InstallPackageCommand = { Add-AppxProvisionedPackage -Online -PackagePath $WingetOutput -SkipLicense -DependencyPackagePath $WingetDepOutput | Out-Null } - Invoke-Expression "$InstallPackageCommand" - } - - Write-Status -Types "@" -Status "Trying to install the App (no dependency): $AppName" -Warning - $InstallPackageCommand = { Add-AppxProvisionedPackage -Online -PackagePath $WingetOutput -SkipLicense | Out-Null } +$WingetParams2 = @{ + Name = "Winget (Method 2)" + CheckExistenceBlock = { winget --version } + InstallCommandBlock = + { + $WingetDepOutput = Install-WingetDependency + $WingetOutput = Get-APIFile -URI "https://api.github.com/repos/microsoft/winget-cli/releases/latest" -ObjectProperty "assets" -FileNameLike "*.msixbundle" -PropertyValue "browser_download_url" -OutputFile "Microsoft.DesktopAppInstaller.msixbundle" + $AppName = Split-Path -Path $WingetOutput -Leaf + + Try { + # Method from: https://github.com/microsoft/winget-cli/blob/master/doc/troubleshooting/README.md#machine-wide-provisioning + If ($WingetDepOutput) { + Write-Status -Types "@" -Status "Trying to install the App (w/ dependency): $AppName" -Warning + $InstallPackageCommand = { Add-AppxProvisionedPackage -Online -PackagePath $WingetOutput -SkipLicense -DependencyPackagePath $WingetDepOutput | Out-Null } Invoke-Expression "$InstallPackageCommand" - } Catch { - Write-Status -Types "@" -Status "Couldn't install '$AppName' automatically, trying to install the App manually..." -Warning - Start-Process "ms-windows-store://pdp/?ProductId=9NBLGGH4NNS1" -Wait # GUI App installer can't install itself } - Remove-Item -Path $WingetOutput - Remove-Item -Path $WingetDepOutput + Write-Status -Types "@" -Status "Trying to install the App (no dependency): $AppName" -Warning + $InstallPackageCommand = { Add-AppxProvisionedPackage -Online -PackagePath $WingetOutput -SkipLicense | Out-Null } + Invoke-Expression "$InstallPackageCommand" + } Catch { + Write-Status -Types "@" -Status "Couldn't install '$AppName' automatically, trying to install the App manually..." -Warning + Start-Process "ms-windows-store://pdp/?ProductId=9NBLGGH4NNS1" -Wait # GUI App installer can't install itself } - } - $ChocolateyParams = @{ - Name = "Chocolatey" - CheckExistenceBlock = { choco --version } - InstallCommandBlock = - { - Set-ExecutionPolicy Bypass -Scope Process -Force - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - } - Time = "13:00" - UpdateScriptBlock = - { - Remove-Item -Path "$env:TEMP\Win-Debloat-Tools\logs\*" -Include "ChocolateyDailyUpgrade_*.log" - Start-Transcript -Path "$env:TEMP\Win-Debloat-Tools\logs\ChocolateyDailyUpgrade_$(Get-Date -Format "yyyy-MM-dd_HH-mm-ss").log" - choco upgrade all --ignore-dependencies --yes | Out-Host - Stop-Transcript - } - PostInstallBlock = { choco install --ignore-dependencies --yes "chocolatey-core.extension" "chocolatey-fastanswers.extension" "dependency-windows10" } + Remove-Item -Path $WingetOutput + Remove-Item -Path $WingetDepOutput } +} - # Install Winget on Windows (Method 1) - Install-PackageManager -PackageManagerFullName $WingetParams.Name -CheckExistenceBlock $WingetParams.CheckExistenceBlock -InstallCommandBlock $WingetParams.InstallCommandBlock -Time $WingetParams.Time -UpdateScriptBlock $WingetParams.UpdateScriptBlock - # Install Winget on Windows (Method 2) - Install-PackageManager -PackageManagerFullName $WingetParams2.Name -CheckExistenceBlock $WingetParams2.CheckExistenceBlock -InstallCommandBlock $WingetParams2.InstallCommandBlock - # Install Chocolatey on Windows - Install-PackageManager -PackageManagerFullName $ChocolateyParams.Name -CheckExistenceBlock $ChocolateyParams.CheckExistenceBlock -InstallCommandBlock $ChocolateyParams.InstallCommandBlock -Time $ChocolateyParams.Time -UpdateScriptBlock $ChocolateyParams.UpdateScriptBlock -PostInstallBlock $ChocolateyParams.PostInstallBlock +$ChocolateyParams = @{ + Name = "Chocolatey" + CheckExistenceBlock = { choco --version } + InstallCommandBlock = + { + Set-ExecutionPolicy Bypass -Scope Process -Force + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + } + Time = "13:00" + UpdateScriptBlock = + { + Remove-Item -Path "$env:TEMP\Win-Debloat-Tools\logs\*" -Include "ChocolateyDailyUpgrade_*.log" + Start-Transcript -Path "$env:TEMP\Win-Debloat-Tools\logs\ChocolateyDailyUpgrade_$(Get-Date -Format "yyyy-MM-dd_HH-mm-ss").log" + choco upgrade all --ignore-dependencies --yes | Out-Host + Stop-Transcript + } + PostInstallBlock = { choco install --ignore-dependencies --yes "chocolatey-core.extension" "chocolatey-fastanswers.extension" "dependency-windows10" } } -Main +# Install Winget on Windows (Method 1) +Install-PackageManager -PackageManagerFullName $WingetParams.Name -CheckExistenceBlock $WingetParams.CheckExistenceBlock -InstallCommandBlock $WingetParams.InstallCommandBlock -Time $WingetParams.Time -UpdateScriptBlock $WingetParams.UpdateScriptBlock +# Install Winget on Windows (Method 2) +Install-PackageManager -PackageManagerFullName $WingetParams2.Name -CheckExistenceBlock $WingetParams2.CheckExistenceBlock -InstallCommandBlock $WingetParams2.InstallCommandBlock +# Install Chocolatey on Windows +Install-PackageManager -PackageManagerFullName $ChocolateyParams.Name -CheckExistenceBlock $ChocolateyParams.CheckExistenceBlock -InstallCommandBlock $ChocolateyParams.InstallCommandBlock -Time $ChocolateyParams.Time -UpdateScriptBlock $ChocolateyParams.UpdateScriptBlock -PostInstallBlock $ChocolateyParams.PostInstallBlock + diff --git a/src/scripts/optimize-performance.ps1 b/src/scripts/Optimize-Performance.ps1 similarity index 97% rename from src/scripts/optimize-performance.ps1 rename to src/scripts/Optimize-Performance.ps1 index 88fcd00..7e0b57a 100644 --- a/src/scripts/optimize-performance.ps1 +++ b/src/scripts/Optimize-Performance.ps1 @@ -149,12 +149,9 @@ function Optimize-Performance() { Set-ItemPropertyVerified -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "Scheduling Category" -Type String -Value "High" # Default: "Medium" } -function Main() { - If (!$Revert) { - Optimize-Performance # Change from stock configurations that slowdowns the system to improve performance - } Else { - Optimize-Performance -Revert - } +If (!$Revert) { + Optimize-Performance # Change from stock configurations that slowdowns the system to improve performance +} Else { + Optimize-Performance -Revert } -Main diff --git a/src/scripts/optimize-privacy.ps1 b/src/scripts/Optimize-Privacy.ps1 similarity index 99% rename from src/scripts/optimize-privacy.ps1 rename to src/scripts/Optimize-Privacy.ps1 index 1a80f2f..44e7a9a 100644 --- a/src/scripts/optimize-privacy.ps1 +++ b/src/scripts/Optimize-Privacy.ps1 @@ -290,12 +290,9 @@ function Optimize-Privacy() { } } -function Main() { - If (!$Revert) { - Optimize-Privacy # Disable Registries that causes slowdowns and privacy invasion - } Else { - Optimize-Privacy -Revert - } +If (!$Revert) { + Optimize-Privacy # Disable Registries that causes slowdowns and privacy invasion +} Else { + Optimize-Privacy -Revert } -Main diff --git a/src/scripts/optimize-security.ps1 b/src/scripts/Optimize-Security.ps1 similarity index 98% rename from src/scripts/optimize-security.ps1 rename to src/scripts/Optimize-Security.ps1 index 5088839..0092df9 100644 --- a/src/scripts/optimize-security.ps1 +++ b/src/scripts/Optimize-Security.ps1 @@ -87,8 +87,5 @@ function Optimize-Security() { #Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name "Enabled" -Type DWord -Value 0 } -function Main() { - Optimize-Security # Improve the Windows Security -} +Optimize-Security # Improve the Windows Security -Main diff --git a/src/scripts/Optimize-ServicesRunning.ps1 b/src/scripts/Optimize-ServicesRunning.ps1 index 9257e6c..658225a 100644 --- a/src/scripts/Optimize-ServicesRunning.ps1 +++ b/src/scripts/Optimize-ServicesRunning.ps1 @@ -108,15 +108,11 @@ function Optimize-ServicesRunning() { Set-ServiceStartup -State 'Manual' -Services $ServicesToManual } -function Main() { - # List all services: - #Get-Service | Select-Object StartType, Status, Name, DisplayName, ServiceType | Sort-Object StartType, Status, Name | Format-Table +# List all services: +#Get-Service | Select-Object StartType, Status, Name, DisplayName, ServiceType | Sort-Object StartType, Status, Name | Format-Table - If (!$Revert) { - Optimize-ServicesRunning # Enable essential Services and Disable bloating Services - } Else { - Optimize-ServicesRunning -Revert - } +If (!$Revert) { + Optimize-ServicesRunning # Enable essential Services and Disable bloating Services +} Else { + Optimize-ServicesRunning -Revert } - -Main diff --git a/src/scripts/Optimize-TaskScheduler.ps1 b/src/scripts/Optimize-TaskScheduler.ps1 index a69ecc5..8da6e73 100644 --- a/src/scripts/Optimize-TaskScheduler.ps1 +++ b/src/scripts/Optimize-TaskScheduler.ps1 @@ -61,15 +61,11 @@ function Optimize-TaskScheduler() { Set-ScheduledTaskState -State 'Enabled' -ScheduledTask $EnableScheduledTasks } -function Main() { - # List all Scheduled Tasks: - #Get-ScheduledTask | Select-Object -Property State, TaskPath, TaskName, Description | Sort-Object State, TaskPath, TaskName | Format-Table +# List all Scheduled Tasks: +#Get-ScheduledTask | Select-Object -Property State, TaskPath, TaskName, Description | Sort-Object State, TaskPath, TaskName | Format-Table - If (!$Revert) { - Optimize-TaskScheduler # Disable Scheduled Tasks that causes slowdowns - } Else { - Optimize-TaskScheduler -Revert - } +If (!$Revert) { + Optimize-TaskScheduler # Disable Scheduled Tasks that causes slowdowns +} Else { + Optimize-TaskScheduler -Revert } - -Main diff --git a/src/scripts/Optimize-WindowsFeaturesList.ps1 b/src/scripts/Optimize-WindowsFeaturesList.ps1 index 90d5946..426bea2 100644 --- a/src/scripts/Optimize-WindowsFeaturesList.ps1 +++ b/src/scripts/Optimize-WindowsFeaturesList.ps1 @@ -42,18 +42,14 @@ function Optimize-WindowsFeaturesList() { Set-OptionalFeatureState -State 'Enabled' -OptionalFeatures $EnableFeatures } -function Main() { - # List all Optional Features: - #Get-WindowsOptionalFeature -Online | Select-Object -Property State, FeatureName, DisplayName, Description | Sort-Object State, FeatureName | Format-Table +# List all Optional Features: +#Get-WindowsOptionalFeature -Online | Select-Object -Property State, FeatureName, DisplayName, Description | Sort-Object State, FeatureName | Format-Table - # List all Windows Packages: - #Get-WindowsPackage -Online | Select-Object -Property ReleaseType, PackageName, PackageState, InstallTime | Sort-Object ReleaseType, PackageState, PackageName | Format-Table +# List all Windows Packages: +#Get-WindowsPackage -Online | Select-Object -Property ReleaseType, PackageName, PackageState, InstallTime | Sort-Object ReleaseType, PackageState, PackageName | Format-Table - If (!$Revert) { - Optimize-WindowsFeaturesList # Disable useless features and Enable features claimed as Optional on Windows, but actually, they are useful - } Else { - Optimize-WindowsFeaturesList -Revert - } +If (!$Revert) { + Optimize-WindowsFeaturesList # Disable useless features and Enable features claimed as Optional on Windows, but actually, they are useful +} Else { + Optimize-WindowsFeaturesList -Revert } - -Main diff --git a/src/scripts/Register-PersonalTweaksList.ps1 b/src/scripts/Register-PersonalTweaksList.ps1 index fac5d8e..e587ad7 100644 --- a/src/scripts/Register-PersonalTweaksList.ps1 +++ b/src/scripts/Register-PersonalTweaksList.ps1 @@ -227,12 +227,8 @@ function Register-PersonalTweaksList() { powercfg -Change Hibernate-Timeout-DC $TimeoutHibernateBattery } -function Main() { - If (!$Revert) { - Register-PersonalTweaksList # Personal UI, Network, Energy and Accessibility Optimizations - } Else { - Register-PersonalTweaksList -Revert - } +If (!$Revert) { + Register-PersonalTweaksList # Personal UI, Network, Energy and Accessibility Optimizations +} Else { + Register-PersonalTweaksList -Revert } - -Main diff --git a/src/scripts/Remove-BloatwareAppsList.ps1 b/src/scripts/Remove-BloatwareAppsList.ps1 index df4cb84..7bd70e4 100644 --- a/src/scripts/Remove-BloatwareAppsList.ps1 +++ b/src/scripts/Remove-BloatwareAppsList.ps1 @@ -154,14 +154,11 @@ function Remove-BloatwareAppsList() { Remove-UWPApp -AppxPackages $Apps } -function Main() { - # List all Packages: - #Get-AppxPackage | Select-Object -Property Name, Architecture, Version, Publisher, InstallLocation, IsFramework, IsBundle, IsDevelopmentMode, NonRemovable, SignatureKind, Status, Dependencies | Sort-Object Publisher, Name, Architecture | Format-Table +# List all Packages: +#Get-AppxPackage | Select-Object -Property Name, Architecture, Version, Publisher, InstallLocation, IsFramework, IsBundle, IsDevelopmentMode, NonRemovable, SignatureKind, Status, Dependencies | Sort-Object Publisher, Name, Architecture | Format-Table - # List all Provisioned Packages: - #Get-AppxProvisionedPackage -Online | Select-Object -Property DisplayName, Architecture, Version, PublisherId, InstallLocation, Region, ResourceId | Sort-Object PublisherId, DisplayName, Architecture | Format-Table +# List all Provisioned Packages: +#Get-AppxProvisionedPackage -Online | Select-Object -Property DisplayName, Architecture, Version, PublisherId, InstallLocation, Region, ResourceId | Sort-Object PublisherId, DisplayName, Architecture | Format-Table - Remove-BloatwareAppsList # Remove the main Bloat from Pre-installed Apps -} +Remove-BloatwareAppsList # Remove the main Bloat from Pre-installed Apps -Main diff --git a/src/scripts/Remove-CapabilitiesList.ps1 b/src/scripts/Remove-CapabilitiesList.ps1 index aaaa372..00ae678 100644 --- a/src/scripts/Remove-CapabilitiesList.ps1 +++ b/src/scripts/Remove-CapabilitiesList.ps1 @@ -7,40 +7,38 @@ function Remove-CapabilitiesList() { [Switch] $Revert ) - Begin { - $DisableCapabilities = @( - "App.StepsRecorder*" # Steps Recorder - "Browser.InternetExplorer*" # Internet Explorer (Also has on Optional Features) - "MathRecognizer*" # Math Recognizer - "Microsoft.Windows.PowerShell.ISE*" # PowerShell ISE - "Microsoft.Windows.WordPad*" # WordPad - "Print.Fax.Scan*" # Fax features - "Print.Management.Console*" # printmanagement.msc - ) - } - - Process { - Write-Title "Windows Capabilities Tweaks" - Write-Section "Uninstall Windows Capabilities from Windows" + $DisableCapabilities = [System.Collections.ArrayList] @( + "App.StepsRecorder*" # Steps Recorder + "Browser.InternetExplorer*" # Internet Explorer (Also has on Optional Features) + "MathRecognizer*" # Math Recognizer + "Microsoft.Windows.PowerShell.ISE*" # PowerShell ISE + "Microsoft.Windows.WordPad*" # WordPad + "Print.Fax.Scan*" # Fax features + "Print.Management.Console*" # printmanagement.msc + ) - If ($Revert) { - Write-Status -Types "*", "Capability" -Status "Reverting the tweaks is set to '$Revert'." -Warning - Set-CapabilityState -State Enabled -Capabilities $DisableCapabilities - } Else { - Set-CapabilityState -State Disabled -Capabilities $DisableCapabilities - } + If (Get-AppxPackage -AllUsers -Name "MicrosoftCorporationII.QuickAssist") { + $DisableCapabilities.Add("App.Support.QuickAssist*") } -} -function Main() { - # List all Windows Capabilities: - #Get-WindowsCapability -Online | Select-Object -Property State, Name, Online, RestartNeeded, LogPath, LogLevel | Sort-Object State, Name | Format-Table + $DisableCapabilities.Sort() - If (!$Revert) { - Remove-CapabilitiesList # Disable useless capabilities which came with Windows, but are legacy now and almost nobody cares + Write-Title "Windows Capabilities Tweaks" + Write-Section "Uninstall Windows Capabilities from Windows" + + If ($Revert) { + Write-Status -Types "*", "Capability" -Status "Reverting the tweaks is set to '$Revert'." -Warning + Set-CapabilityState -State Enabled -Capabilities $DisableCapabilities } Else { - Remove-CapabilitiesList -Revert + Set-CapabilityState -State Disabled -Capabilities $DisableCapabilities } } -Main +# List all Windows Capabilities: +#Get-WindowsCapability -Online | Select-Object -Property State, Name, Online, RestartNeeded, LogPath, LogLevel | Sort-Object State, Name | Format-Table + +If (!$Revert) { + Remove-CapabilitiesList # Disable useless capabilities which came with Windows, but are legacy now and almost nobody cares +} Else { + Remove-CapabilitiesList -Revert +} diff --git a/src/scripts/remove-msedge.ps1 b/src/scripts/Remove-MSEdge.ps1 similarity index 85% rename from src/scripts/remove-msedge.ps1 rename to src/scripts/Remove-MSEdge.ps1 index 6f5a7a4..0b233dd 100644 --- a/src/scripts/remove-msedge.ps1 +++ b/src/scripts/Remove-MSEdge.ps1 @@ -4,22 +4,6 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"Remove-I Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"Remove-UWPApp.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"Set-ItemPropertyVerified.psm1" -function Main() { - $Ask = "Are you sure you want to remove Microsoft Edge from Windows?`nYou can reinstall it anytime.`nNote: all users logged in will remain." - - switch (Show-Question -Title "Warning" -Message $Ask -BoxIcon "Warning") { - 'Yes' { - Remove-MSEdge - } - 'No' { - Write-Host "Aborting..." - } - 'Cancel' { - Write-Host "Aborting..." # With Yes, No and Cancel, the user can press Esc to exit - } - } -} - function Remove-MSEdge() { $PathToLMEdgeUpdate = "HKLM:\SOFTWARE\Microsoft\EdgeUpdate" @@ -57,4 +41,16 @@ function Remove-MSEdge() { Remove-ItemVerified -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Temp" -Recurse -Force | Out-Host } -Main +$Ask = "Are you sure you want to remove Microsoft Edge from Windows?`nYou can reinstall it anytime.`nNote: all users logged in will remain." + +switch (Show-Question -Title "Warning" -Message $Ask -BoxIcon "Warning") { + 'Yes' { + Remove-MSEdge + } + 'No' { + Write-Host "Aborting..." + } + 'Cancel' { + Write-Host "Aborting..." # With Yes, No and Cancel, the user can press Esc to exit + } +} diff --git a/src/scripts/remove-onedrive.ps1 b/src/scripts/Remove-OneDrive.ps1 similarity index 100% rename from src/scripts/remove-onedrive.ps1 rename to src/scripts/Remove-OneDrive.ps1 diff --git a/src/scripts/remove-xbox.ps1 b/src/scripts/Remove-Xbox.ps1 similarity index 78% rename from src/scripts/remove-xbox.ps1 rename to src/scripts/Remove-Xbox.ps1 index 60af390..bf4f7bb 100644 --- a/src/scripts/remove-xbox.ps1 +++ b/src/scripts/Remove-Xbox.ps1 @@ -5,22 +5,6 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"Remove-U Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"Set-ItemPropertyVerified.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"Individual-Tweaks.psm1" -function Main() { - $Ask = "This will remove and/or disable all the Xbox:`n - Apps;`n - Services and;`n - GameBar;`n - GameDVR.`n`nDo you want to proceed?" - - switch (Show-Question -Title "Warning" -Message $Ask -BoxIcon "Warning") { - 'Yes' { - Remove-Xbox # Remove all Xbox related Apps, services, etc. - } - 'No' { - Write-Host "Aborting..." - } - 'Cancel' { - Write-Host "Aborting..." # With Yes, No and Cancel, the user can press Esc to exit - } - } -} - function Remove-Xbox() { $PathToLMServicesXbgm = "HKLM:\SYSTEM\CurrentControlSet\Services\xbgm" $TweakType = "Xbox" @@ -55,4 +39,16 @@ function Remove-Xbox() { Disable-XboxGameBarDVRandMode } -Main +$Ask = "This will remove and/or disable all the Xbox:`n - Apps;`n - Services and;`n - GameBar;`n - GameDVR.`n`nDo you want to proceed?" + +switch (Show-Question -Title "Warning" -Message $Ask -BoxIcon "Warning") { + 'Yes' { + Remove-Xbox # Remove all Xbox related Apps, services, etc. + } + 'No' { + Write-Host "Aborting..." + } + 'Cancel' { + Write-Host "Aborting..." # With Yes, No and Cancel, the user can press Esc to exit + } +} diff --git a/src/scripts/repair-windows.ps1 b/src/scripts/Repair-WindowsSystem.ps1 similarity index 98% rename from src/scripts/repair-windows.ps1 rename to src/scripts/Repair-WindowsSystem.ps1 index 5787b18..6547f01 100644 --- a/src/scripts/repair-windows.ps1 +++ b/src/scripts/Repair-WindowsSystem.ps1 @@ -3,7 +3,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"Set-Item # Adapted from: https://github.com/ChrisTitusTech/win10script -function Repair-Windows() { +function Repair-WindowsSystem() { Write-Title "Repair major Windows problems" Write-Section "Reset Windows Hosts file" @@ -72,8 +72,4 @@ function Repair-Windows() { netsh winsock reset | Out-Host } -function Main() { - Repair-Windows -} - -Main +Repair-WindowsSystem diff --git a/src/scripts/Use-DebloatSoftware.ps1 b/src/scripts/Use-DebloatSoftware.ps1 index afc9191..248f135 100644 --- a/src/scripts/Use-DebloatSoftware.ps1 +++ b/src/scripts/Use-DebloatSoftware.ps1 @@ -36,12 +36,9 @@ function Use-DebloatSoftware() { Pop-Location } -function Main() { - If (!$Revert) { - Use-DebloatSoftware # [AUTOMATED] ShutUp10 with recommended configs and AdwCleaner for Adware/Virus Scanning. - } Else { - Use-DebloatSoftware -Revert - } +If (!$Revert) { + Use-DebloatSoftware # [AUTOMATED] ShutUp10 with recommended configs and AdwCleaner for Adware/Virus Scanning. +} Else { + Use-DebloatSoftware -Revert } -Main diff --git a/src/scripts/other-scripts/install-archwsl.ps1 b/src/scripts/other-scripts/Install-ArchWSL.ps1 similarity index 100% rename from src/scripts/other-scripts/install-archwsl.ps1 rename to src/scripts/other-scripts/Install-ArchWSL.ps1 diff --git a/src/scripts/other-scripts/install-wsl.ps1 b/src/scripts/other-scripts/Install-WSL.ps1 similarity index 100% rename from src/scripts/other-scripts/install-wsl.ps1 rename to src/scripts/other-scripts/Install-WSL.ps1 diff --git a/src/utils/DIY/ssd-tune.ps1 b/src/utils/DIY/Optimize-SSD.ps1 similarity index 75% rename from src/utils/DIY/ssd-tune.ps1 rename to src/utils/DIY/Optimize-SSD.ps1 index be5819c..46b9765 100644 --- a/src/utils/DIY/ssd-tune.ps1 +++ b/src/utils/DIY/Optimize-SSD.ps1 @@ -1,7 +1,7 @@ -function Main() { +function Optimize-SSD() { # SSD life improvement fsutil behavior set DisableLastAccess 1 fsutil behavior set EncryptPagingFile 0 } -Main \ No newline at end of file +Optimize-SSD diff --git a/src/utils/DIY/boot-advanced-startup.ps1 b/src/utils/DIY/Restart-AdvancedMode.ps1 similarity index 74% rename from src/utils/DIY/boot-advanced-startup.ps1 rename to src/utils/DIY/Restart-AdvancedMode.ps1 index 755d0a7..3c0bec2 100644 --- a/src/utils/DIY/boot-advanced-startup.ps1 +++ b/src/utils/DIY/Restart-AdvancedMode.ps1 @@ -1,4 +1,4 @@ -function Main() { +function Restart-AdvancedMode() { # -r: Restart after shutdown # -o: Reboot into the advanced menu # -t: Time before shutdown @@ -6,4 +6,4 @@ function Main() { shutdown -o -r -f -t 0 } -Main \ No newline at end of file +Restart-AdvancedMode diff --git a/src/utils/individual-tweaks.psm1 b/src/utils/Individual-Tweaks.psm1 similarity index 100% rename from src/utils/individual-tweaks.psm1 rename to src/utils/Individual-Tweaks.psm1 diff --git a/src/utils/install-individual-system-apps.psm1 b/src/utils/Install-Individual-System-Apps.psm1 similarity index 79% rename from src/utils/install-individual-system-apps.psm1 rename to src/utils/Install-Individual-System-Apps.psm1 index 9c6bd22..c672061 100644 --- a/src/utils/install-individual-system-apps.psm1 +++ b/src/utils/Install-Individual-System-Apps.psm1 @@ -7,20 +7,15 @@ $Script:TweakType = "App" function Install-Cortana() { $Apps = @("9NFFX4SZZ23L") - - Write-Status -Types "*", $TweakType -Status "Installing Cortana..." Install-Software -Name "Cortana" -Packages $Apps -PackageProvider 'MsStore' } function Install-DolbyAudio() { $Apps = @("9NJZD5S7QN99") - - Write-Status -Types "*", $TweakType -Status "Installing Dolby Audio..." Install-Software -Name "Dolby Audio" -Packages $Apps -PackageProvider 'MsStore' } function Install-MicrosoftEdge() { - Write-Status -Types "*", $TweakType -Status "Installing Microsoft Edge..." Install-Software -Name "Microsoft Edge" -Packages "Microsoft.Edge" } @@ -32,35 +27,31 @@ function Install-OneDrive() { function Install-PaintPaint3D() { $Apps = @("9PCFS5B6T72H", "9NBLGGH5FV99") - - Write-Status -Types "*", $TweakType -Status "Installing Paint + Paint 3D..." Install-Software -Name "Paint + Paint 3D" -Packages $Apps -PackageProvider 'MsStore' } function Install-PhoneLink() { $Apps = @("9NMPJ99VJBWV") - - Write-Status -Types "*", $TweakType -Status "Installing Phone Link (Your Phone)..." Install-Software -Name "Phone Link (Your Phone)" -Packages $Apps -PackageProvider 'MsStore' Enable-PhoneLink } +function Install-QuickAssist() { + $Apps = @("9P7BP5VNWKX5") + Install-Software -Name "Quick Assist" -Packages $Apps -PackageProvider 'MsStore' +} + function Install-SoundRecorder() { $Apps = @("9WZDNCRFHWKN") - - Write-Status -Types "*", $TweakType -Status "Installing Sound Recorder..." Install-Software -Name "Sound Recorder" -Packages $Apps -PackageProvider 'MsStore' } function Install-TaskbarWidgetsApp() { $Apps = @("9MSSGKG348SP") - - Write-Status -Types "*", $TweakType -Status "Installing Taskbar Widgets..." Install-Software -Name "Taskbar Widgets" -Packages $Apps -PackageProvider 'MsStore' } function Install-UWPWindowsMediaPlayer() { - Write-Status -Types "*", $TweakType -Status "Installing Windows Media Player (UWP)..." Install-Software -Name "Windows Media Player (UWP)" -Packages @("9WZDNCRFJ3PT") -PackageProvider 'MsStore' } @@ -79,8 +70,6 @@ function Install-Xbox() { Write-Status -Types "*", $TweakType -Status "Enabling ALL Xbox Services..." Set-ServiceStartup -State 'Manual' -Services $XboxServices - - Write-Status -Types "*", $TweakType -Status "Installing Xbox Apps again..." Install-Software -Name "Missing Xbox Apps" -Packages $XboxApps -PackageProvider 'MsStore' -NoDialog Write-Status -Types "*", $TweakType -Status "Enabling Xbox Game Monitoring..."