【发布时间】:2019-12-24 22:50:23
【问题描述】:
我一直在尝试通过 powershell 卸载更新。我正在尝试使用启动进程来利用 wusa.exe。当我通过卸载和安静开关时,它无法运行。我在设置事件日志中收到此错误:
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 ")
我了解到您必须在 Windows 10 上以不同的方式执行此操作,但我找不到任何示例。我怎么能运行这个?如果我在没有静音的情况下运行它,它会弹出窗口以毫无问题地卸载更新。
这是我要运行的内容。
Start-Process -FilePath wusa.exe -ArgumentList "/uninstall /KB:4512516 /quiet /norestart" -ErrorAction SilentlyContinue -WindowStyle Hidden -Wait
【问题讨论】:
-
1)
Start-Process的-ArgumentList参数是一个数组。 2) 你不需要Start-Process来运行命令。只需输入命令并按Enter:wusa /kb:4512516 /uninstall /quiet /norestart -
由于出现错误 2147942487“参数不正确”,无法卸载 Windows 更新。 (命令行:“C:\WINDOWS\system32\wusa.exe”/kb:4512516 /uninstall /quiet /norestart”)同样的事情。我在脚本中使用它,所以希望能够将 -wait 参数与 start-process 一起使用
-
我猜你只是不能在 wusa.exe /uninstall 中使用 quiet。我看到很多人试图使用我认为你可以但它没有显示在帮助文件中。需要远程卸载更新,所以不知道如何绕过它。
标签: windows powershell updates uninstallation start-process