From 00591766cb8c56d1a062f7bceb294f52a3d3f68e Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Sat, 15 Jun 2024 01:01:47 +0200 Subject: [PATCH] Quick method now downloads script without git Fixed typo in README.md (Thanks to @eltociear) --- Get.ps1 | 57 ++++++++++++++++++++----------------------------------- README.md | 6 +++--- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/Get.ps1 b/Get.ps1 index b8a96da..327b511 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -42,47 +42,32 @@ Write-Output "------------------------------------------------------------------ Write-Output " Win11Debloat Script - Get" Write-Output "-------------------------------------------------------------------------------------------" -# Make sure winget is installed and is at least v1.4 -if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) -replace 'v','' -gt 1.4)) { - # Check if git is installed. Install git if it isn't installed yet - try - { - git | Out-Null - } - catch [System.Management.Automation.CommandNotFoundException] - { - Write-Output "> Installing git..." - winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade +# Navigate to user temp directory +cd $env:TEMP - # Add default install location of git to path - $env:Path += ';C:\Program Files\Git\cmd' - - Write-Output "" - } +Write-Output "> Downloading Win11Debloat..." - # Navigate to user temp directory - cd $env:TEMP +# Download latest version of Win11Debloat from github as zip archive +wget http://github.com/raphire/win11debloat/archive/master.zip -O win11debloat-temp.zip - # Download Win11Debloat from github - Write-Output "> Downloading Win11Debloat..." - git clone https://github.com/Raphire/Win11Debloat/ +# Unzip archive to Win11Debloat folder +Expand-Archive win11debloat-temp.zip Win11Debloat - # Make list of arguments - $args = $($PSBoundParameters.GetEnumerator() | ForEach-Object {"-$($_.Key)"}) +# Remove archive +rm win11debloat-temp.zip - Write-Output "" +# Make list of arguments to pass on to the script +$args = $($PSBoundParameters.GetEnumerator() | ForEach-Object {"-$($_.Key)"}) - # Start & run script with the provided arguments - Write-Output "> Running Win11Debloat..." - $debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File .\Win11Debloat\Win11Debloat.ps1 $args" - $debloatProcess.WaitForExit() +Write-Output "" - Write-Output "" +# Run Win11Debloat script with the provided arguments +Write-Output "> Running Win11Debloat..." +$debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File .\Win11Debloat\Win11Debloat-master\Win11Debloat.ps1 $args" +$debloatProcess.WaitForExit() - # Cleanup, remove Win11Debloat directory - Write-Output "> Cleaning up..." - Remove-Item -LiteralPath "Win11Debloat" -Force -Recurse -} -else { - Write-Error "Unable to start script, WinGet is not installed or outdated." -} +Write-Output "" + +# Cleanup, remove Win11Debloat directory +Write-Output "> Cleaning up..." +Remove-Item -LiteralPath "Win11Debloat" -Force -Recurse diff --git a/README.md b/README.md index 85d774d..39f564f 100644 --- a/README.md +++ b/README.md @@ -217,14 +217,14 @@ The default mode applies the changes that are recommended for most users, expand ### Quick method -Download & run the script automatically via powershell. Please note that this will install git if it's not already installed on your system. +Download & run the script automatically via powershell. 1. Open powershell as an administrator. 2. Copy and paste the code below into powershell, press enter to run the script: ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/Raphire/Win11Debloat/master/Get.ps1"))) ``` -3. Wait for the script to automatically install git and download Win11Debloat. +3. Wait for the script to automatically download Win11Debloat. 4. A new powershell window will open showing the Win11Debloat menu. Select either the default or custom mode to continue. 5. Carefully read through and follow the on-screen instructions. @@ -278,7 +278,7 @@ The quick and advanced method support parameters to tailor the behaviour of the | -RemoveApps | Remove the default selection of bloatware apps. | | -RemoveAppsCustom | Remove all apps from the 'CustomAppsList' file. IMPORTANT: Run the script with the `-RunAppConfigurator` parameter to create this file first. No apps will be removed if this file does not exist! | | -RunAppConfigurator | Run the app configurator to create a 'CustomAppsList' file. Run the script with the `-RemoveAppsCustom` parameter to remove these apps. | -| -RemoveCommApps | Remove the Mail, Calender, and People apps. | +| -RemoveCommApps | Remove the Mail, Calendar, and People apps. | | -RemoveW11Outlook | Remove the new Outlook for Windows app. | | -RemoveDevApps | Remove developer-related apps such as Remote Desktop, DevHome and Power Automate. | | -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. |