mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-02-17 07:56:24 +00:00
Fix crash on clearing Start menu pinned apps for all users (#447)
As reported in #445
This commit is contained in:
@@ -2228,12 +2228,12 @@ function GetUserDirectory {
|
|||||||
$exitIfPathNotFound = $true
|
$exitIfPathNotFound = $true
|
||||||
)
|
)
|
||||||
|
|
||||||
if (-not (CheckIfUserExists -userName $userName)) {
|
|
||||||
Write-Error "User $userName does not exist on this system"
|
|
||||||
AwaitKeyToExit
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (-not (CheckIfUserExists -userName $userName) -and $userName -ne "*") {
|
||||||
|
Write-Error "User $userName does not exist on this system"
|
||||||
|
AwaitKeyToExit
|
||||||
|
}
|
||||||
|
|
||||||
$userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName"
|
$userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName"
|
||||||
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
|
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user