浏览代码

Add 'KBRemover.ps1'

Ethan 2 年前
父节点
当前提交
1b1463023d
共有 1 个文件被更改,包括 26 次插入0 次删除
  1. 26
    0
      KBRemover.ps1

+ 26
- 0
KBRemover.ps1 查看文件

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
+
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
+
17
+if ($hotfix1installed -or $hotfix2installed) {
18
+    # Create a System Restore Point
19
+    Checkpoint-Computer -Description "Hotfixes Removed"
20
+    # Display a message
21
+    Write-Host "Hotfixes removed."
22
+} else {
23
+    # Display a message
24
+    Write-Host "Hotfixes not detected. No operation was performed."
25
+}
26
+pause

Powered by TurnKey Linux.