Keep only the main branch (#183)

* 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 <clienthax@gmail.com>
main
Plínio Larrubia 2 weeks ago
parent d8872ff6ae
commit c5405a9dc5
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -3,7 +3,7 @@
**Warning**: this file is subject to changing without notice. **Warning**: this file is subject to changing without notice.
I would be happy to extend the collection of scripts. 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 ## 🖌 Coding Style
@ -51,13 +51,16 @@ Follow at least the minimal required to help.
### Via HTTPS ### Via HTTPS
```sh ```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 On VSCode the modules seems to not load all the divergent variables and functions dynamically, to fix that, all modules should be imported manually:
git clone -b develop --filter=tree:0 git@github.com:LeDragoX/Win-Debloat-Tools.git
```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) ## 🔎 How to find specific Tweaks? (One method)

@ -30,7 +30,7 @@ I need to change these files:
## 🚀 Download Latest Version ## 🚀 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] > [!IMPORTANT]
> *Use on a fresh Windows install to notice the differences. Using an admin account is recommended to avoid any compatibility issues.* > *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
<th>Branch to Download</th> <th>Branch to Download</th>
<th>Version(s) Supported</th> <th>Version(s) Supported</th>
<th>Edition(s)</th> <th>Edition(s)</th>
<th>Architecture</th>
<th>PowerShell Version</th> <th>PowerShell Version</th>
</tr> </tr>
</thead> </thead>
<tbody align="center"> <tbody align="center">
<tr> <tr>
<td> <td>
<h4><a href="https://github.com/LeDragoX/Win-Debloat-Tools/archive/main.zip">⬇️ Main</a></h4>(Stable) <h4><a href="https://github.com/LeDragoX/Win-Debloat-Tools/archive/main.zip">⬇️ Main</a></h4>(Current)
</td> </td>
<td rowspan="2">23H2 or Older</td> <td rowspan="2">23H2 or Older</td>
<td rowspan="2">Home / Pro</td> <td rowspan="2">Home / Pro</td>
<td rowspan="2"><img width=20px src="src/assets/powershell-icon.png" style="vertical-align: bottom" /> v5.1+</td> <td rowspan="2">
</tr> x86/x64 ONLY<br>
<tr> ARM/ARM64 will break your installation (<a href="https://github.com/LeDragoX/Win-Debloat-Tools/issues/97">#97</a>)
<td>
<h4><a href="https://github.com/LeDragoX/Win-Debloat-Tools/archive/develop.zip">⬇️ Develop</a></h4>(Newer)
</td> </td>
<td rowspan="2"><img width=20px src="src/assets/powershell-icon.png" style="vertical-align: bottom" /> v5.1+</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -1544,7 +1544,9 @@ function Show-GUI() {
If ($InstallGitGnupgSshSetup.CheckState -eq "Checked") { If ($InstallGitGnupgSshSetup.CheckState -eq "Checked") {
If (!($Script:UninstallSwitch)) { 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 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 { } Else {
$AppsSelected.WingetApps.AddRange(@("Git.Git", "GnuPG.GnuPG")) # Installed before inside the script $AppsSelected.WingetApps.AddRange(@("Git.Git", "GnuPG.GnuPG")) # Installed before inside the script
} }
@ -1572,7 +1574,7 @@ function Show-GUI() {
} }
If ($InstallJavaJdks.CheckState -eq "Checked") { 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" $InstallJavaJdks.CheckState = "Unchecked"
} }

@ -22,11 +22,6 @@ function Optimize-WindowsFeaturesList() {
"WorkFolders-Client" # Work Folders Client "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-Title "Optional Features Tweaks"
Write-Section "Uninstall Optional Features from Windows" Write-Section "Uninstall Optional Features from Windows"
@ -36,9 +31,6 @@ function Optimize-WindowsFeaturesList() {
} Else { } Else {
Set-OptionalFeatureState -State 'Disabled' -OptionalFeatures $DisableFeatures Set-OptionalFeatureState -State 'Disabled' -OptionalFeatures $DisableFeatures
} }
Write-Section "Install Optional Features from Windows"
Set-OptionalFeatureState -State 'Enabled' -OptionalFeatures $EnableFeatures
} }
# List all Optional Features: # List all Optional Features:

@ -252,7 +252,7 @@ function Register-PersonalTweaksList() {
$TimeoutScreenPluggedIn = 10 $TimeoutScreenPluggedIn = 10
$TimeoutStandByBattery = 15 $TimeoutStandByBattery = 15
$TimeoutStandByPluggedIn = 180 $TimeoutStandByPluggedIn = 30
$TimeoutDiskBattery = 20 $TimeoutDiskBattery = 20
$TimeoutDiskPluggedIn = 30 $TimeoutDiskPluggedIn = 30

@ -54,8 +54,9 @@ function Remove-BloatwareAppsList() {
# Default Windows 11 apps # Default Windows 11 apps
"Clipchamp.Clipchamp" # Clipchamp Video Editor "Clipchamp.Clipchamp" # Clipchamp Video Editor
"Microsoft.OutlookForWindows" # Microsoft Outlook
"MicrosoftTeams" # Microsoft Teams
"MicrosoftWindows.Client.WebExperience" # Taskbar Widgets "MicrosoftWindows.Client.WebExperience" # Taskbar Widgets
"MicrosoftTeams" # Microsoft Teams / Preview
# [DIY] Remove the # to Uninstall # [DIY] Remove the # to Uninstall

@ -145,11 +145,11 @@ function Set-GPGKey() {
Write-Host "Before exporting your public and private keys, add manually an email." -ForegroundColor Cyan 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: 1 (RSA and RSA) [ENTER]." -ForegroundColor Cyan
Write-Host "Type: 4096 [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: y [ENTER]." -ForegroundColor Cyan
Write-Host "Then: $(git config --global user.name) [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: $(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: O (Ok) [ENTER]." -ForegroundColor Cyan
Write-Host "Then: [your passphrase] [ENTER]." -ForegroundColor Cyan Write-Host "Then: [your passphrase] [ENTER]." -ForegroundColor Cyan
Write-Host "Then: [your passphrase again] [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-Status -Types "@" -Status 'gpg --delete-keys $(git config --global user.name)'
Write-Host "Copying all files to $GnuPGPath" 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/*" -Exclude "*.gpg", "*.key", "*.pub", "*.rev" -Recurse
Remove-ItemVerified -Path "$GnuPGPath/trustdb.gpg" 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)" gpg --output "$($GnuPGFileName)_secret.gpg" --armor --export-secret-key "$(git config --global user.email)"
# Get the exact Key ID from the system # 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))) { If (($KeyId -eq "") -or ($null -eq $KeyId) -or ($KeyId -ne $CurrentGPGKey)) {
Write-Host "GPG Key id found: $key_id." Write-Host "GPG Key id found: $KeyId."
Write-Host "Registering the GPG Key ID to git user..." 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 "Your user.signingkey on git is: $(git config --global user.signingkey)"
Write-Host "Enabling commit.gpgsign on git..." 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" 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 Get-Content -Path "$GnuPGPath/$($GnuPGFileName)_public.gpg" -Encoding UTF8
} Else { } 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" Write-Host "Importing your key on $GnuPGPath\$($GnuPGFileName)_public.gpg and $($GnuPGFileName)_secret.gpg"

@ -10,10 +10,7 @@ function Install-ArchWSL() {
If ($OSArch -like "x64") { 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" $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)..." Write-Status -Types "+" -Status "Installing ArchWSL Certificate ($OSArch)..."
Import-Certificate -FilePath $CertOutput -CertStoreLocation Cert:\LocalMachine\Root | Out-Host certutil.exe -addstore "Root" $CertOutput | 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
$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" $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)..." Write-Status -Types "+" -Status "Installing ArchWSL ($OSArch)..."
Add-AppxPackage -Path $ArchWSLOutput Add-AppxPackage -Path $ArchWSLOutput

Loading…
Cancel
Save