0

I have been trying to uninstall an update via powershell. I am trying to leverage wusa.exe using start-process. When i pass the uninstall and quiet switches it fails to run. I get this error in setup event logs:

Windows update  could not be uninstalled because of error 2147942487 "The parameter is incorrect." (Command line: ""C:\WINDOWS\system32\wusa.exe" /KB:4512516 /uninstall  /quiet /norestart ")

I've read you have to do this differently with Windows 10 but I can't find any examples. How can I run this? If I run it without silent it pops up the window to uninstall the update with no issues.

Here is what i am trying to run.

Start-Process -FilePath wusa.exe -ArgumentList "/uninstall /KB:4512516 /quiet /norestart" -ErrorAction SilentlyContinue -WindowStyle Hidden -Wait
techguy1029
  • 743
  • 10
  • 29
  • 1) The `-ArgumentList` parameter to `Start-Process` is an array. 2) You don't need `Start-Process` to run a command. Just type the command and press `Enter`: `wusa /kb:4512516 /uninstall /quiet /norestart` – Bill_Stewart Aug 19 '19 at 17:35
  • Windows update could not be uninstalled because of error 2147942487 "The parameter is incorrect." (Command line: ""C:\WINDOWS\system32\wusa.exe" /kb:4512516 /uninstall /quiet /norestart") same thing. Im using this in a script so would like to be able to use the - wait parameter with start-process – KeetsScrimalittle Aug 19 '19 at 17:48
  • I guess you just cant use quiet with wusa.exe /uninstall. i see so many people trying to use that i thought you could but its not shown in the help file. Need to uninstall updates remotely so not sure how i can bypass that. – KeetsScrimalittle Aug 19 '19 at 19:50

1 Answers1

0

Found Remove-Windowspackage cmdlet which is a native cmdlet in powershell. Using that instead.