从Powershell卸载设备 [英] Uninstall Device from powershell

查看:89
本文介绍了从Powershell卸载设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行自动化程序,该程序会安装预设的OS/w驱动程序和配置.我继承了自动化的第二手,有很多东西.我有一个带有混合图形的系统,它会亲自验证显示驱动程序.现在,我可以走到机器上,打开设备管理器,右键单击其中一台图形设备,单击卸载"(我不删除驱动程序文件),然后自动化将继续.完成后,系统将重新启动,并且两个设备驱动程序都将恢复.我想知道是否有可以通过自动化执行相同任务的powershell命令?

I run automation that installs a preset OS /w Drivers and configuration. I inherited the automation second hand and there's a lot to it. I have a system with hybrid graphics and it hands on verifying the display drivers. Now, I can walk over to the machine, open device manager, right click on one of the graphics devices, click uninstall (i do not delete the driver files) and then the automation continues. Once its done, the system restarts and both device drivers are back. I am wondering if there is a powershell command i can run to do the same task through automation?

你们怎么想!

推荐答案

您可以使用WMI实例执行此操作:

You can do this using WMI instance:

get-wmiobject -Query "select * from win32_systemdriver where caption=`"THING_TO_REMOVE`"" } | ForEach  { $_.StopService()
$_.Delete()
 } 

这篇关于从Powershell卸载设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆