Avatar of samiam41
samiam41
Flag for United States of America

asked on 

Update script to include output and skip pc if offline

Hey Experts.  I found a script on the web that does most of what I wanted it to accomplish but i need a little help as my testing hasn't yielded much in the way of positive results.

$HotfixID = "KB5005031"

$ComputerList = Get-Content "C:\Users\Desktop\machines.txt"

ForEach ($Computer in $ComputerList)
{
Get-HotFix -ComputerName $Computer |where {$_.HotFixID -Match $HotfixID}|select @{n="Computer";e={$Computer}},HotFixID,InstalledOn

Open in new window

How can I get this to skip a pc that doesn't respond so that the script doesn't get hung up and where can I output which computers have the KB?
PowershellWindows 10Scripting Languages

Avatar of undefined
Last Comment
samiam41

8/22/2022 - Mon