Cleaned variable names

This commit is contained in:
poslop
2026-01-14 12:20:41 -06:00
parent b21f669ffd
commit db0eacbfa0

View File

@@ -14,7 +14,7 @@ $profileListKey = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileLis
$sids = Get-ChildItem $profileListKey $sids = Get-ChildItem $profileListKey
$printerPaths = @( $HKUsersPrinterPaths = @(
'\Printers\Connections', '\Printers\Connections',
'\Printers\ConvertUserDevModesCount', '\Printers\ConvertUserDevModesCount',
'\Software\Xerox\PrinterDriver', '\Software\Xerox\PrinterDriver',
@@ -42,10 +42,10 @@ 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 ($HKUsersPrinterPath in $HKUsersPrinterPaths) {
try { try {
Remove-Item -Path "Registry::HKEY_USERS\${sid}${printerPath}" -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}${printerPath}" --ForegroundColor Green Write-Host "Removed user profile key HKEY_USERS\${sid}${HKUsersPrinterPath}" --ForegroundColor Green
} catch { } catch {
Write-Host "Error: $($_.Exception.Message)" Write-Host "Error: $($_.Exception.Message)"
} }