Advertisement
goezler

Druckerfix

Mar 22nd, 2021
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # "19041.867.1.8" = KB5000802
  2. # "18362.1440.1.7" = KB5000808
  3.  
  4. $UpdateArray = @("19041.867.1.8", "18362.1440.1.7")
  5.  
  6. foreach ($UpdateVersion in $UpdateArray) {
  7.     $SearchUpdates = dism /online /get-packages | findstr "Package_for" | findstr "$UpdateVersion"  
  8.     if ($SearchUpdates) {
  9.         $update = $SearchUpdates.split(":")[1].replace(" ", "")
  10.         write-host ("Update result found: " + $update )
  11.         dism /Online /Remove-Package /PackageName:$update /quiet /norestart
  12.     } else {
  13.         write-host ("Update " + $UpdateVersion + " not found.")
  14.     }
  15. }
  16. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement