No Description

KBRemover.ps1 1010B

12345678910111213141516171819202122232425262728293031
  1. try {
  2. # Check if Hotfix KB5020687 is Installed
  3. $hotfix1 = Get-HotFix -Id KB5020687
  4. if ($hotfix1) {
  5. # Uninstall Hotfix KB5020687
  6. Uninstall-WindowsUpdate -KBArticleID KB5020687 -Confirm:$false
  7. $hotfix1installed = $true
  8. }
  9. # Check if Hotfix KB5019959 is Installed
  10. $hotfix2 = Get-HotFix -Id KB5019959
  11. if ($hotfix2) {
  12. # Uninstall Hotfix KB5019959
  13. Uninstall-WindowsUpdate -KBArticleID KB5019959 -Confirm:$false
  14. $hotfix2installed = $true
  15. }
  16. if ($hotfix1installed -or $hotfix2installed) {
  17. # Create a System Restore Point
  18. Checkpoint-Computer -Description "Hotfixes Removed"
  19. # Display a message
  20. Write-Host "Hotfixes removed."
  21. [console]::beep()
  22. } else {
  23. # Display a message
  24. Write-Host "Hotfixes not detected. No operation was performed."
  25. }
  26. } catch {
  27. $errorMessage = $_.Exception.Message
  28. [System.Windows.Forms.MessageBox]::Show("An error occurred: $errorMessage")
  29. }

Powered by TurnKey Linux.