Skip to content

Commit aa54564

Browse files
committed
Added logging
Changed global to script variables
1 parent 76d5b83 commit aa54564

File tree

4 files changed

+65
-52
lines changed

4 files changed

+65
-52
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
LastSettings
22
SavedSettings
33
CustomAppsList
4+
Win11Debloat.log

Get.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ param (
22
[switch]$Silent,
33
[switch]$Verbose,
44
[switch]$Sysprep,
5+
[string]$LogPath,
56
[string]$User,
67
[switch]$CreateRestorePoint,
78
[switch]$RunAppsListGenerator, [switch]$RunAppConfigurator,
@@ -76,7 +77,7 @@ Invoke-WebRequest http://github.com/raphire/win11debloat/archive/master.zip -Out
7677
if (Test-Path "$env:TEMP/Win11Debloat/Win11Debloat-master") {
7778
Write-Output ""
7879
Write-Output "> Cleaning up old Win11Debloat folder..."
79-
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Win11Debloat-master" -Exclude CustomAppsList,SavedSettings | Remove-Item -Recurse -Force
80+
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Win11Debloat-master" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force
8081
}
8182

8283
Write-Output ""
@@ -115,7 +116,7 @@ if (Test-Path "$env:TEMP/Win11Debloat/Win11Debloat-master") {
115116
Write-Output "> Cleaning up..."
116117

117118
# Cleanup, remove Win11Debloat directory
118-
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Win11Debloat-master" -Exclude CustomAppsList,SavedSettings | Remove-Item -Recurse -Force
119+
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Win11Debloat-master" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force
119120
}
120121

121122
Write-Output ""

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ The quick and advanced usage methods support switch parameters. A table of all t
342342
| -CreateRestorePoint | Create a system restore point before making any changes. Unless a restore point was already created in the last 24 hours. |
343343
| -Silent | Suppresses all interactive prompts, so the script will run without requiring any user input. |
344344
| -Sysprep | Run the script in Sysprep mode. All changes will be applied to the Windows default user profile and will only affect new user accounts. |
345+
| -LogPath | Specify where Win11Debloat will create the log file, always called `Win11Debloat.log`. The log will be saved to the root folder of the script if the specified path doesn't exist. |
345346
| -User `<USERNAME>` | Run the script for the specified user, instead of the currently logged in user. This user must have logged on atleast once, and cannot be logged in at the time the script is run. |
346347
| -RunDefaults | Run the script with the default settings. |
347348
| -RunSavedSettings | Run the script with the saved custom settings from last time. These settings are saved to and read from the `SavedSettings` file in the root folder of the script. |

0 commit comments

Comments
 (0)