# Check if Hotfix KB5020687 is Installed $hotfix1 = Get-HotFix -Id KB5020687 if ($hotfix1) { # Uninstall Hotfix KB5020687 Uninstall-WindowsUpdate -KBArticleID KB5020687 -Confirm:$false $hotfix1installed = $true } # Check if Hotfix KB5019959 is Installed $hotfix2 = Get-HotFix -Id KB5019959 if ($hotfix2) { # Uninstall Hotfix KB5019959 Uninstall-WindowsUpdate -KBArticleID KB5019959 -Confirm:$false $hotfix2installed = $true } if ($hotfix1installed -or $hotfix2installed) { # Create a System Restore Point Checkpoint-Computer -Description "Hotfixes Removed" # Display a message Write-Host "Hotfixes removed." } else { # Display a message Write-Host "Hotfixes not detected. No operation was performed." } pause