【问题标题】:Running Wusa.exe /uninstall with Start-Process not working使用 Start-Process 运行 Wusa.exe /uninstall 不起作用
【发布时间】: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


【解决方案1】:

找到 Remove-Windowspackage cmdlet,它是 powershell 中的本机 cmdlet。改为使用它。

【讨论】:

    猜你喜欢
    • 2021-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 2019-08-16
    相关资源
    最近更新 更多