cleaned logging
This commit is contained in:
@@ -35,7 +35,6 @@ foreach ($HKLMPrinterPaths in $HKLMPrinterPaths) {
|
|||||||
Remove-Item -Path "Registry::${HKLMPrinterPaths}" -Recurse -Force -ErrorAction Stop
|
Remove-Item -Path "Registry::${HKLMPrinterPaths}" -Recurse -Force -ErrorAction Stop
|
||||||
Write-Host "Removed local machine key ${HKLMPrinterPaths}" -ForegroundColor Green
|
Write-Host "Removed local machine key ${HKLMPrinterPaths}" -ForegroundColor Green
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Error: $($_.Exception.Message)"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +47,6 @@ foreach ($sidItem in $sids) {
|
|||||||
Remove-Item -Path "Registry::HKEY_USERS\${sid}${HKUsersPrinterPath}" -Recurse -Force -ErrorAction Stop
|
Remove-Item -Path "Registry::HKEY_USERS\${sid}${HKUsersPrinterPath}" -Recurse -Force -ErrorAction Stop
|
||||||
Write-Host "Removed user profile key HKEY_USERS\${sid}${HKUsersPrinterPath}" -ForegroundColor Green
|
Write-Host "Removed user profile key HKEY_USERS\${sid}${HKUsersPrinterPath}" -ForegroundColor Green
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Error: $($_.Exception.Message)"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user