mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-25 23:16:15 +01:00
fix: handle missing LOCALAPPDATA in user data path assignment (#852)
This commit is contained in:
+7
-1
@@ -174,7 +174,13 @@ if (-not $isAdmin) {
|
||||
# Define script-level variables & paths
|
||||
$script:Version = "2026.08.24"
|
||||
$configPath = Join-Path $PSScriptRoot 'Config'
|
||||
$script:UserDataPath = Join-Path $env:LOCALAPPDATA 'Win11Debloat'
|
||||
# Deployment environments such as SCCM task sequences may not define LOCALAPPDATA.
|
||||
if ([string]::IsNullOrWhiteSpace($env:LOCALAPPDATA)) {
|
||||
$script:UserDataPath = $PSScriptRoot
|
||||
}
|
||||
else {
|
||||
$script:UserDataPath = Join-Path $env:LOCALAPPDATA 'Win11Debloat'
|
||||
}
|
||||
$script:LogsPath = Join-Path $script:UserDataPath 'Logs'
|
||||
$schemasPath = Join-Path $PSScriptRoot 'Schemas'
|
||||
$scriptsPath = Join-Path $PSScriptRoot 'Scripts'
|
||||
|
||||
Reference in New Issue
Block a user