From 8436c8d81cdfdf530def9a1e0bb97fb8c58b3ddd Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Tue, 4 Oct 2022 21:10:29 +0200 Subject: [PATCH] Made it easier to use the script; The script no longer requires manually changing the Execution Policy to run. --- .github/FUNDING.yml | 1 + README.md | 9 ++++----- Run.bat | 1 + Run.ps1 | 34 ---------------------------------- Win10Debloat.ps1 | 2 ++ 5 files changed, 8 insertions(+), 39 deletions(-) create mode 100644 Run.bat delete mode 100644 Run.ps1 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6ee381d..08c06a3 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ +github: raphire ko_fi: raphire \ No newline at end of file diff --git a/README.md b/README.md index 69933ae..d9a8d8c 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,10 @@ Disclaimer: I believe this script to be completely safe to run, but use this scr ### Easy method: 1. [Download the latest version of the script](https://github.com/Raphire/Win10Debloat/archive/master.zip), and extract the .ZIP file to your desired location. -2. Open powershell as an administrator. -3. Enable powershell execution by entering the following command: Set-ExecutionPolicy Unrestricted -Force -4. Navigate to the Win10Debloat folder and run the script by right-clicking the 'Run.ps1' file and selecting the 'Run with Powershell' option. -5. Accept the windows UAC prompt to run the script as administrator, this is required for the script to function. -6. Select either default, or custom setup depending on what changes you want to make. Custom setup will allow you to choose exactly which changes you want to make, and which changes you want to skip. +2. Navigate to the Win10Debloat folder +3. Double click the 'Run.bat' file to start the script. +4. Accept the windows UAC prompt to run the script as administrator, this is required for the script to function. +5. Select either default, or custom setup depending on what changes you want to make. Custom setup will allow you to choose exactly which changes you want to make, and which changes you want to skip. ### Advanced method: This method gives you the option to run the script with certain arguments to tailor the behaviour of the script to your needs without requiring any user input during runtime, making it quicker and easier to deploy on a large number of systems. diff --git a/Run.bat b/Run.bat new file mode 100644 index 0000000..57d8220 --- /dev/null +++ b/Run.bat @@ -0,0 +1 @@ +PowerShell -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10Debloat.ps1"' -Verb RunAs}" diff --git a/Run.ps1 b/Run.ps1 deleted file mode 100644 index b04cb68..0000000 --- a/Run.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -Write-Output "Attempting to launch script with admin privileges..." - -PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Unrestricted -File ""$PSScriptRoot\Win10Debloat.ps1""' -Verb RunAs}"; - -<#------------------------------------------------------------------------------------------------------------------------------------------------> -It's possible to tweak the behaviour of the script by running the script with one or more of the arguments in the ArgumentList as shown below. -This allows you to tailor the behaviour of the script to your needs without any user input during runtime, making it quicker and easier to deploy. - -The example below configures the script to only remove apps and disable bing in windows search: - -PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile - -ExecutionPolicy Unrestricted - -File ""$PSScriptRoot\Win10Debloat.ps1"" - -RemoveApps - -DisableBing' - -Verb RunAs}"; - -Supported Arguments: --RunDefaults | Run the script with windows 10 default settings. --RunWin11Defaults | Run the script with windows 11 default settings. --RemoveApps | Remove all bloatware apps from the list found in README.md. --DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. --DisableBing | Disable bing & cortana in windows search. --DisableLockscreenTips | Disable tips & tricks on the lockscreen. --DisableWindowsSuggestions | Disable tips, tricks and suggestions in the startmenu and settings, and ads in windows explorer. --DisableOnedrive | Hide the onedrive folder in the windows explorer sidepanel. --DisableChat | Hide the chat icon on the taskbar. --DisableWidgets | Hide the widget icon on the taskbar. --Disable3dObjects | Hide the 3D objects folder under 'This pc' in windows explorer. --DisableMusic | Hide the music folder under 'This pc' in windows explorer. --DisableIncludeInLibrary | Disable the 'Include in library' option in the context menu. --DisableGiveAccessTo | Disable the 'Give access to' option in the context menu. --DisableShare | Disable the 'Share' option in the context menu. -<------------------------------------------------------------------------------------------------------------------------------------------------#> diff --git a/Win10Debloat.ps1 b/Win10Debloat.ps1 index 6e7d241..8efbf12 100644 --- a/Win10Debloat.ps1 +++ b/Win10Debloat.ps1 @@ -1,3 +1,5 @@ +#Requires -RunAsAdministrator + [CmdletBinding(SupportsShouldProcess)] param (