windows - 使用 Start-Process 运行 Wusa.exe /uninstall 不起作用
问题描述
我一直在尝试通过 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
解决方案
找到 Remove-Windowspackage cmdlet,它是 powershell 中的本机 cmdlet。改用那个。
推荐阅读
- python - 使用 read_excel 读取选定的数据
- deployment - 使用pm2创建react app部署到digitalocean问题
- php - 为什么 PHP 在计算没有指定时区的时间戳时会在某些日期分配不同的时区?
- jenkins - Jenkins 管道:从上游作业访问单个阶段结果
- python - 修改 pandas 数据框列中的字符串
- acumos - Acumos“站点管理员”更改带来意想不到的副作用
- docker - IntelliJ 无法连接到受保护的 tcp Docker 套接字
- php - Symfony bundle 配置数组节点默认值合并
- vmware - 如何在 vmware 机器上获取远程访问权限
- mysql - 使用两个表进行数据操作