From 96e90aacb680da2a0c9c12dbc8263f1f1624d723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pl=C3=ADnio=20Larrubia?= Date: Sun, 8 Sep 2024 16:57:53 -0300 Subject: [PATCH] Keep only the main branch (#183) * Change resolution check to use the primary monitor's working area. (#168) Fixes oversized windows on multiple monitor setups when using dpi scaling. * Use Pascal Casing inside Get-CurrentResolution.psm1 - Remove unused variable $bounds * Fix ArchWSL cert install - No manual steps required * Fix GPG signing key when a key already exists for git config * Stop logging before using the GPG/SSH setup * Fix Java EclipseAdoptium JDK installation * Remove Outlook app * fix: revert Stand by time when plugged in to 30 minutes * docs: Add section to import all modules in the terminal * refactor: Remove unneeded Windows Optional Features (#180) - NET Framework 3.5 - NET Framework 4.x + ASPNET 4.x * docs: Prepare to use main branch only - Set the Architecture as a requirement --------- Co-authored-by: Haxy --- CONTRIBUTING.md | 13 ++++++++----- README.md | 14 +++++++------- WinDebloatTools.ps1 | 4 +++- src/scripts/Optimize-WindowsFeaturesList.ps1 | 8 -------- src/scripts/Register-PersonalTweaksList.ps1 | 2 +- src/scripts/Remove-BloatwareAppsList.ps1 | 3 ++- .../other-scripts/Git-GnupgSshKeysSetup.ps1 | 17 +++++++++-------- src/scripts/other-scripts/Install-ArchWSL.ps1 | 5 +---- 8 files changed, 31 insertions(+), 35 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b64d3a63..2b32b7c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ⚠ **Warning**: this file is subject to changing without notice. I would be happy to extend the collection of scripts. -If you want to send me a **PULL REQUEST**, send you PRs to the `develop` branch, select your `local branch (from)` and put into `develop`, i'll check your code, request changes if necessary or approve, and merge directly unless it's a "Draft PR". +If you want to send me a **PULL REQUEST**, send you PRs to the `main` branch, I'll check your code, request changes if necessary or approve, and merge directly unless it's a "Draft PR". ## 🖌 Coding Style @@ -51,13 +51,16 @@ Follow at least the minimal required to help. ### Via HTTPS ```sh -git clone -b develop --filter=tree:0 https://github.com/LeDragoX/Win-Debloat-Tools.git +git clone --filter=tree:0 https://github.com/LeDragoX/Win-Debloat-Tools.git ``` -### Or SSH +## 👾 Debugging with all modules -```sh -git clone -b develop --filter=tree:0 git@github.com:LeDragoX/Win-Debloat-Tools.git +On VSCode the modules seems to not load all the divergent variables and functions dynamically, to fix that, all modules should be imported manually: + +```ps1 +Get-Item .\src\lib\*.psm1 | Import-Module -PassThru -Force +Get-Item .\src\lib\**\*.psm1 | Import-Module -PassThru -Force ``` ## 🔎 How to find specific Tweaks? (One method) diff --git a/README.md b/README.md index 96c59906..00625e4f 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ I need to change these files: ## 🚀 Download Latest Version -Code located in the `main` branch is considered stable, the `develop` branch contains the most recent features. +Code located in the `main` branch is considered bleeding-edge, but big features/reworks will be implemented in a separate branch. > [!IMPORTANT] > *Use on a fresh Windows install to notice the differences. Using an admin account is recommended to avoid any compatibility issues.* @@ -42,22 +42,22 @@ Code located in the `main` branch is considered stable, the `develop` branch con Branch to Download Version(s) Supported Edition(s) + Architecture PowerShell Version -

⬇️ Main

(Stable) +

⬇️ Main

(Current) 23H2 or Older Home / Pro - v5.1+ - - - -

⬇️ Develop

(Newer) + + x86/x64 ONLY
+ ARM/ARM64 will break your installation (#97) + v5.1+ diff --git a/WinDebloatTools.ps1 b/WinDebloatTools.ps1 index 2658af8c..5a467643 100644 --- a/WinDebloatTools.ps1 +++ b/WinDebloatTools.ps1 @@ -1544,7 +1544,9 @@ function Show-GUI() { If ($InstallGitGnupgSshSetup.CheckState -eq "Checked") { If (!($Script:UninstallSwitch)) { + Stop-Logging # Don't log any credential info after this point Open-PowerShellFilesCollection -RelativeLocation "src\scripts\other-scripts" -Scripts @("Git-GnupgSshKeysSetup.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage + Start-Logging -File "$CurrentFileName-$(Get-Date -Format "yyyy-MM")" } Else { $AppsSelected.WingetApps.AddRange(@("Git.Git", "GnuPG.GnuPG")) # Installed before inside the script } @@ -1572,7 +1574,7 @@ function Show-GUI() { } If ($InstallJavaJdks.CheckState -eq "Checked") { - $AppsSelected.WingetApps.AddRange(@("EclipseAdoptium.Temurin.8", "EclipseAdoptium.Temurin.11", "EclipseAdoptium.Temurin.18")) + $AppsSelected.WingetApps.AddRange(@("EclipseAdoptium.Temurin.8.JDK", "EclipseAdoptium.Temurin.11.JDK", "EclipseAdoptium.Temurin.18.JDK")) $InstallJavaJdks.CheckState = "Unchecked" } diff --git a/src/scripts/Optimize-WindowsFeaturesList.ps1 b/src/scripts/Optimize-WindowsFeaturesList.ps1 index 5392ae9d..d87e4bd1 100644 --- a/src/scripts/Optimize-WindowsFeaturesList.ps1 +++ b/src/scripts/Optimize-WindowsFeaturesList.ps1 @@ -22,11 +22,6 @@ function Optimize-WindowsFeaturesList() { "WorkFolders-Client" # Work Folders Client ) - $EnableFeatures = @( - "NetFx3" # NET Framework 3.5 - "NetFx4Extended-ASPNET45" # NET Framework 4.x + ASPNET 4.x - ) - Write-Title "Optional Features Tweaks" Write-Section "Uninstall Optional Features from Windows" @@ -36,9 +31,6 @@ function Optimize-WindowsFeaturesList() { } Else { Set-OptionalFeatureState -State 'Disabled' -OptionalFeatures $DisableFeatures } - - Write-Section "Install Optional Features from Windows" - Set-OptionalFeatureState -State 'Enabled' -OptionalFeatures $EnableFeatures } # List all Optional Features: diff --git a/src/scripts/Register-PersonalTweaksList.ps1 b/src/scripts/Register-PersonalTweaksList.ps1 index 44990162..4295b813 100644 --- a/src/scripts/Register-PersonalTweaksList.ps1 +++ b/src/scripts/Register-PersonalTweaksList.ps1 @@ -252,7 +252,7 @@ function Register-PersonalTweaksList() { $TimeoutScreenPluggedIn = 10 $TimeoutStandByBattery = 15 - $TimeoutStandByPluggedIn = 180 + $TimeoutStandByPluggedIn = 30 $TimeoutDiskBattery = 20 $TimeoutDiskPluggedIn = 30 diff --git a/src/scripts/Remove-BloatwareAppsList.ps1 b/src/scripts/Remove-BloatwareAppsList.ps1 index e9ebc5b8..bf442691 100644 --- a/src/scripts/Remove-BloatwareAppsList.ps1 +++ b/src/scripts/Remove-BloatwareAppsList.ps1 @@ -54,8 +54,9 @@ function Remove-BloatwareAppsList() { # Default Windows 11 apps "Clipchamp.Clipchamp" # Clipchamp – Video Editor + "Microsoft.OutlookForWindows" # Microsoft Outlook + "MicrosoftTeams" # Microsoft Teams "MicrosoftWindows.Client.WebExperience" # Taskbar Widgets - "MicrosoftTeams" # Microsoft Teams / Preview # [DIY] Remove the # to Uninstall diff --git a/src/scripts/other-scripts/Git-GnupgSshKeysSetup.ps1 b/src/scripts/other-scripts/Git-GnupgSshKeysSetup.ps1 index 64581e59..f26185d2 100644 --- a/src/scripts/other-scripts/Git-GnupgSshKeysSetup.ps1 +++ b/src/scripts/other-scripts/Git-GnupgSshKeysSetup.ps1 @@ -145,11 +145,11 @@ function Set-GPGKey() { Write-Host "Before exporting your public and private keys, add manually an email." -ForegroundColor Cyan Write-Host "Type: 1 (RSA and RSA) [ENTER]." -ForegroundColor Cyan Write-Host "Type: 4096 [ENTER]." -ForegroundColor Cyan - Write-Host "Then: 0 (does not expire at all) [ENTER]." -ForegroundColor Cyan + Write-Host "Then: 0 (does not expire at all) or `"10y`" [ENTER]." -ForegroundColor Cyan Write-Host "Then: y [ENTER]." -ForegroundColor Cyan Write-Host "Then: $(git config --global user.name) [ENTER]." -ForegroundColor Cyan Write-Host "Then: $(git config --global user.email) [ENTER]" -ForegroundColor Cyan - Write-Host "Then: Anything you want (e.g. git keys) [ENTER]." -ForegroundColor Cyan + Write-Host "Then: Anything you want (e.g. Git Keys) [ENTER]." -ForegroundColor Cyan Write-Host "Then: O (Ok) [ENTER]." -ForegroundColor Cyan Write-Host "Then: [your passphrase] [ENTER]." -ForegroundColor Cyan Write-Host "Then: [your passphrase again] [ENTER]." -ForegroundColor Cyan @@ -160,7 +160,7 @@ function Set-GPGKey() { Write-Status -Types "@" -Status 'gpg --delete-keys $(git config --global user.name)' Write-Host "Copying all files to $GnuPGPath" - Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse + Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse -Force Remove-ItemVerified -Path "$GnuPGPath/*" -Exclude "*.gpg", "*.key", "*.pub", "*.rev" -Recurse Remove-ItemVerified -Path "$GnuPGPath/trustdb.gpg" @@ -169,12 +169,13 @@ function Set-GPGKey() { gpg --output "$($GnuPGFileName)_secret.gpg" --armor --export-secret-key "$(git config --global user.email)" # Get the exact Key ID from the system - $key_id = $((gpg --list-keys --keyid-format LONG).Split(" ")[5].Split("/")[1]) + $KeyId = $((gpg --list-keys --keyid-format LONG).Split(" ")[5].Split("/")[1]) + $CurrentGPGKey = $(git config --global user.signingkey) - If (!(($key_id -eq "") -or ($null -eq $key_id))) { - Write-Host "GPG Key id found: $key_id." + If (($KeyId -eq "") -or ($null -eq $KeyId) -or ($KeyId -ne $CurrentGPGKey)) { + Write-Host "GPG Key id found: $KeyId." Write-Host "Registering the GPG Key ID to git user..." - git config --global user.signingkey "$key_id" + git config --global user.signingkey "$KeyId" Write-Host "Your user.signingkey on git is: $(git config --global user.signingkey)" Write-Host "Enabling commit.gpgsign on git..." @@ -183,7 +184,7 @@ function Set-GPGKey() { Write-Host "Copy and Paste the lines below on your`nGithub/Gitlab > Settings > SSH and GPG Keys > New GPG Key" Get-Content -Path "$GnuPGPath/$($GnuPGFileName)_public.gpg" -Encoding UTF8 } Else { - Write-Host "Failed to retrieve your key_id: $key_id" + Write-Host "Failed to retrieve your key_id: $KeyId" } Write-Host "Importing your key on $GnuPGPath\$($GnuPGFileName)_public.gpg and $($GnuPGFileName)_secret.gpg" diff --git a/src/scripts/other-scripts/Install-ArchWSL.ps1 b/src/scripts/other-scripts/Install-ArchWSL.ps1 index 923cffb7..aac6e720 100644 --- a/src/scripts/other-scripts/Install-ArchWSL.ps1 +++ b/src/scripts/other-scripts/Install-ArchWSL.ps1 @@ -10,10 +10,7 @@ function Install-ArchWSL() { If ($OSArch -like "x64") { $CertOutput = Get-APIFile -URI "https://api.github.com/repos/yuk7/ArchWSL/releases/latest" -ObjectProperty "assets" -FileNameLike "ArchWSL-AppX_*_$OSArch.cer" -PropertyValue "browser_download_url" -OutputFile "ArchWSL.cer" Write-Status -Types "+" -Status "Installing ArchWSL Certificate ($OSArch)..." - Import-Certificate -FilePath $CertOutput -CertStoreLocation Cert:\LocalMachine\Root | Out-Host - Write-Status -Types "?" -Status "The certificate needs to be installed manually, the cmdlet didn't work for some reason..." -Warning - Write-Status -Types "@" -Status "Steps: Install Certificate... (Next) > Select Local Machine (Next) > Next > Finish > OK" -Warning - Start-Process -FilePath "$CertOutput" -Wait + certutil.exe -addstore "Root" $CertOutput | Out-Host $ArchWSLOutput = Get-APIFile -URI "https://api.github.com/repos/yuk7/ArchWSL/releases/latest" -ObjectProperty "assets" -FileNameLike "ArchWSL-AppX_*_$OSArch.appx" -PropertyValue "browser_download_url" -OutputFile "ArchWSL.appx" Write-Status -Types "+" -Status "Installing ArchWSL ($OSArch)..." Add-AppxPackage -Path $ArchWSLOutput