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

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

问题描述

我运行自动安装预设的操作系统/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天全站免登陆