Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit d627f9c

Browse files
committed
logs to $ENV:LOCALAPPDATA\debloat-logs\
1 parent 3300fc5 commit d627f9c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

debloat.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
77
Exit
88
}
99

10-
$logsFolder = "$PWD\logs\"
10+
$logsFolder = "$ENV:LOCALAPPDATA\debloat-logs\"
1111
$logMessage = "The log folder doesn't exist. This folder will be used for storing logs created after the script runs. Creating now."
1212
If (Test-Path $logsFolder) {
1313
Write-Output "$logsFolder exists. Skipping."
@@ -19,14 +19,12 @@ Else {
1919
Write-Output "The folder $logsFolder was successfully created." `n
2020
Start-Sleep 1
2121
}
22-
$logfile = Get-Date -Format "ddMMyyhh"
22+
$logfile = Get-Date -Format "ddMMyyhhss"
2323
$logfilepath = "$logsFolder/log-$logfile.log"
2424
Start-Transcript -path $logfilepath -IncludeInvocationHeader -Append
2525

26-
2726
Clear-Host
2827

29-
3028
$GetOSVersion = (Get-ItemProperty -Path "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentBuildNumber
3129
if ($GetOSVersion -lt '22000') {
3230
throw "Windows build number $GetOSVersion is not supported"
@@ -850,7 +848,7 @@ Function RemoveApps {
850848

851849
#!!!Enable this if you want to reset values to default!!!
852850
#Remove-Item -Path "HKLM:Software\Policies\Microsoft\Windows\CloudContent" -Force
853-
Stop-Process Explorer -Force
851+
Stop-Process -ProcessName Explorer -Force
854852
Start-Sleep -Seconds 10
855853
Start-Process Explorer -Wait
856854
}

0 commit comments

Comments
 (0)