mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-26 07:26:18 +01:00
fix: handle missing LOCALAPPDATA in user data path assignment (#852)
This commit is contained in:
@@ -174,7 +174,13 @@ if (-not $isAdmin) {
|
|||||||
# Define script-level variables & paths
|
# Define script-level variables & paths
|
||||||
$script:Version = "2026.08.24"
|
$script:Version = "2026.08.24"
|
||||||
$configPath = Join-Path $PSScriptRoot 'Config'
|
$configPath = Join-Path $PSScriptRoot 'Config'
|
||||||
|
# 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:UserDataPath = Join-Path $env:LOCALAPPDATA 'Win11Debloat'
|
||||||
|
}
|
||||||
$script:LogsPath = Join-Path $script:UserDataPath 'Logs'
|
$script:LogsPath = Join-Path $script:UserDataPath 'Logs'
|
||||||
$schemasPath = Join-Path $PSScriptRoot 'Schemas'
|
$schemasPath = Join-Path $PSScriptRoot 'Schemas'
|
||||||
$scriptsPath = Join-Path $PSScriptRoot 'Scripts'
|
$scriptsPath = Join-Path $PSScriptRoot 'Scripts'
|
||||||
|
|||||||
Reference in New Issue
Block a user