This repository was archived by the owner on Jul 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
7
7
Exit
8
8
}
9
9
10
- $logsFolder = " $PWD \ logs\"
10
+ $logsFolder = " $ENV: LOCALAPPDATA \debloat- logs\"
11
11
$logMessage = " The log folder doesn't exist. This folder will be used for storing logs created after the script runs. Creating now."
12
12
If (Test-Path $logsFolder ) {
13
13
Write-Output " $logsFolder exists. Skipping."
@@ -19,14 +19,12 @@ Else {
19
19
Write-Output " The folder $logsFolder was successfully created." `n
20
20
Start-Sleep 1
21
21
}
22
- $logfile = Get-Date - Format " ddMMyyhh "
22
+ $logfile = Get-Date - Format " ddMMyyhhss "
23
23
$logfilepath = " $logsFolder /log-$logfile .log"
24
24
Start-Transcript - path $logfilepath - IncludeInvocationHeader - Append
25
25
26
-
27
26
Clear-Host
28
27
29
-
30
28
$GetOSVersion = (Get-ItemProperty - Path " HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion" ).CurrentBuildNumber
31
29
if ($GetOSVersion -lt ' 22000' ) {
32
30
throw " Windows build number $GetOSVersion is not supported"
@@ -850,7 +848,7 @@ Function RemoveApps {
850
848
851
849
# !!!Enable this if you want to reset values to default!!!
852
850
# Remove-Item -Path "HKLM:Software\Policies\Microsoft\Windows\CloudContent" -Force
853
- Stop-Process Explorer - Force
851
+ Stop-Process - ProcessName Explorer - Force
854
852
Start-Sleep - Seconds 10
855
853
Start-Process Explorer - Wait
856
854
}
You can’t perform that action at this time.
0 commit comments