Forum Discussion

oryxway's avatar
oryxway
Iron Contributor
Jan 30, 2025

Detection Script for KB installed

This was in Microsoft Intune documentation and it did not work and shows as Failed

$sysinfo = systeminfo.exe
$result = $sysinfo -match KB<KB number>

if ($result)
 {
    Write-Output "Found KB<KB number>"
    exit 0
 }
 else
 {
    exit 1
 }

 

 

This is what I rewrote and have plugged it in, and still have to get the screen green or showing as installed. Is this correct?

 

$sysinfo = systeminfo.exe

$result = $sysinfo -match "KB5050021"

 

if ($result) {

    Write-Output "Found KB5050021"

    exit 0

} else {

    Write-Output "KB5050021 not found"

    exit 1

}

1 Reply

  • Jeff Gilbert's avatar
    Jeff Gilbert
    Copper Contributor

    This code works for me, but I'm not sure what you mean by "and still have to get the screen green or showing as installed."

Resources