相当于Powershell的devcon.exe



我正在尝试将此windows . bat文件转换为Powershell。因此,如果有人能给我提供我需要做的事情的powershell版本,我会非常感激。

Batch File:

for /f "delims=:" %%x in ('%SystemRoot%SetupScriptsNIC_Fixdevcon.exe findall *dev_07B0*') do %SystemRoot%SetupScriptsNIC_Fixdevcon.exe remove "@%%x"
%SystemRoot%SetupScriptsNIC_Fixdevcon.exe rescan

亲切的问候,

我在某个地方发现了类似的东西。它是powershell,至少pputil是windows自带的。

# dell2020vidfix.ps1
# Get-PnpDevice -PresentOnly -Status ERROR,DEGRADED,UNKNOWN
foreach ($dev in Get-PnpDevice -FriendlyName '*Intel(R) UHD Graphics 630*') {
pnputil /remove-device $dev.InstanceId }
pnputil /scan-devices
Microsoft PnP Utility
Removing device:       PCIVEN_8086&DEV_3E92&SUBSYS_09361028&REV_003&11583659&8&10
Device removed successfully.
Microsoft PnP Utility
Scanning for device hardware changes.
Scan complete.

最新更新