cleaned string variables
This commit is contained in:
@@ -42,8 +42,6 @@ foreach ($sidKey in $sids) {
|
|||||||
$sid = $sidKey.PSChildName
|
$sid = $sidKey.PSChildName
|
||||||
$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
|
||||||
@@ -52,11 +50,6 @@ foreach ($sidKey in $sids) {
|
|||||||
Write-Host "Error: $($_.Exception.Message)"
|
Write-Host "Error: $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (-not $mounted) {
|
|
||||||
$unloadResult = & reg.exe unload "HKU\$sid" 2>&1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user