Ensure folders exist

This commit is contained in:
Jeffrey
2026-06-23 01:21:40 +02:00
parent 5bd8c9957b
commit 0a8999f635
2 changed files with 10 additions and 5 deletions

View File

@@ -212,6 +212,9 @@ Write-Host ""
Write-Host ""
# Log script output to 'Win11Debloat.log' at the specified path
$logDir = if ($LogPath) { $LogPath } else { Split-Path $script:DefaultLogPath -Parent }
if (-not (Test-Path $logDir)) { New-Item -ItemType Directory -Path $logDir -Force | Out-Null }
if ($LogPath -and (Test-Path $LogPath)) {
Start-Transcript -Path (Join-Path $LogPath 'Win11Debloat.log') -Append -IncludeInvocationHeader -Force | Out-Null
}