Can anyone please explain why the code keeps returning so many values? I’m trying to get either pass or fail not combinations of the two. I’m blatantly overlooking something here.
I’m trying to get values 2004, 1405, 1200
PS U:\> $strKey = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" $valueName = "testIsntInHere" $objReg = [WMIClass]"root\default:StdRegProv" $strValue = $objReg.GetDWORDValue($HKEY_CURRENT_USER, $strKey, $valueName) | Select-Object -property ReturnValue $strResult = "" switch ($strValue.ReturnValue) { 0 {$strResult = "Enabled" $status += "pass"} 1 {$strResult = "Prompt" $status += "fail"} 3 {$strResult = "Disabled" $status += "fail"} default {$strResult = "Unknown"} } $systemAttrs += ("Computer Authentication Check : " + $strResult) Write-Output $status fail pass pass pass pass pass pass pass pass pass pass pass pass pass ______________________________________________________________________________________________________________