This commit is contained in:
poslop
2026-01-14 12:17:13 -06:00
parent 7b121a4f2f
commit b21f669ffd

View File

@@ -43,12 +43,12 @@ foreach ($sidKey in $sids) {
$profilePath = (Get-ItemProperty -Path $sidKey.PSPath -Name ProfileImagePath).ProfileImagePath $profilePath = (Get-ItemProperty -Path $sidKey.PSPath -Name ProfileImagePath).ProfileImagePath
foreach ($printerPath in $printerPaths) { foreach ($printerPath in $printerPaths) {
try { try {
Remove-Item -Path "Registry::HKEY_USERS\${sid}${printerPath}" -Recurse -Force -ErrorAction Stop Remove-Item -Path "Registry::HKEY_USERS\${sid}${printerPath}" -Recurse -Force -ErrorAction Stop
Write-Host "Removed user profile key HKEY_USERS\${sid}${printerPath}" --ForegroundColor Green Write-Host "Removed user profile key HKEY_USERS\${sid}${printerPath}" --ForegroundColor Green
} catch { } catch {
Write-Host "Error: $($_.Exception.Message)" Write-Host "Error: $($_.Exception.Message)"
} }
} }
} }