Hey Guys,
Here is a quick worklet I wrote that I’ve been using to fix the MS BSOD error. Please let me know your thoughts, looking to improve my coding skills.
Evaluation Code:
powershell20 lines
#KBs that want to query for
$kb = '5000802'
$kb2 = '5001567'
# Checks for installed KB
$installed = Get-HotFix -Id "KB$kb" -ErrorAction SilentlyContinue
$installed2 = Get-HotFix -ID "KB$kb2" -ErrorAction SilentlyContinue
if (( $installed )) {
Exit 1
}elseif($installed2){
exit 0
#exits with output in the report
write-host = "$kb2 patch Installed"
} else {
Exit 0
#exits but can view the output via the report.
Write-Host = "$kb Not installed"
} Remediation Code:
powershell11 lines
$SF = "C:\"
$file = 'windows10.0-kb5001567.msu'
$kb = '5000802'
$installed = Get-HotFix -ID "KB$kb2" -ErrorAction SilentlyContinue
if($installed){
Copy-Item .\$file -Destination "$SF\$file"
Start-Process -FilePath "wusa.exe" -ArguementList "$SF\$file /quiet /norestart" -wait
Remove-Item $SF\$file
}Else{
write-host = 'patch installed'}You can upload the file to and just adjust the code to patch other KBs.
This discussion is archived and closed to replies. Continue it in the Automox Community Slack.
Discuss on Slack