Nenhuma descrição

KBRemover.ps1 758B

1234567891011121314151617181920212223242526
  1. # Check if Hotfix KB5020687 is Installed
  2. $hotfix1 = Get-HotFix -Id KB5020687
  3. if ($hotfix1) {
  4. # Uninstall Hotfix KB5020687
  5. Uninstall-WindowsUpdate -KBArticleID KB5020687 -Confirm:$false
  6. $hotfix1installed = $true
  7. }
  8. # Check if Hotfix KB5019959 is Installed
  9. $hotfix2 = Get-HotFix -Id KB5019959
  10. if ($hotfix2) {
  11. # Uninstall Hotfix KB5019959
  12. Uninstall-WindowsUpdate -KBArticleID KB5019959 -Confirm:$false
  13. $hotfix2installed = $true
  14. }
  15. if ($hotfix1installed -or $hotfix2installed) {
  16. # Create a System Restore Point
  17. Checkpoint-Computer -Description "Hotfixes Removed"
  18. # Display a message
  19. Write-Host "Hotfixes removed."
  20. } else {
  21. # Display a message
  22. Write-Host "Hotfixes not detected. No operation was performed."
  23. }
  24. pause

Powered by TurnKey Linux.