Handle missing PointAndPrint values in PS1

This commit is contained in:
Carlos Polop
2026-01-20 23:04:35 +01:00
parent a363541d77
commit 1b8706aac6
+4 -1
View File
@@ -836,7 +836,10 @@ if (Test-Path $pnKey) {
Write-Host "NoWarningNoElevationOnInstall: $noWarn"
Write-Host "UpdatePromptSettings: $updatePrompt"
if (($restrict -eq 0) -and ($noWarn -eq 1) -and ($updatePrompt -eq 2)) {
$hasAllValues = ($null -ne $restrict) -and ($null -ne $noWarn) -and ($null -ne $updatePrompt)
if (-not $hasAllValues) {
Write-Host "PointAndPrint policy values are missing or not configured" -ForegroundColor Gray
} elseif (($restrict -eq 0) -and ($noWarn -eq 1) -and ($updatePrompt -eq 2)) {
Write-Host "Potentially vulnerable to PrintNightmare misconfiguration" -ForegroundColor Red
} else {
Write-Host "PointAndPrint policy is not in the known risky configuration" -ForegroundColor Green