Powershell to remove device driver


  1. Posts : 38
    10 2004
       #1

    Powershell to remove device driver


    I'm trying to write a powershell script to look for a specific device driver and uninstall it.
    I'm trying

    $device = Get-WmiObject Win32_PnPSignedDriver | select DeviceName,InfName| where {$_.devicename -like "*Realtek PCIE*"}
    Because for some reason when i select InfName by itself, it returns nothing. but when I do it alongside DeviceName it gives me the inf. I then want to take this inf name and use it in

    Remove-WindowsDriver -Path "c:\offline" -Driver "OEM1.inf"

    so I can totally remove the driver on start up. Even though I try disabling the device, it always manages to reenable itself.
      My Computer


  2. Posts : 16,015
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hello @JiminyBillyBob,

    You could try using cmd prompt!

    To find out if you definitely have the correct name first, type this in a cmd prompt and press <ENTER> . . .

    Code:
    wmic sysdriver get name

    What is the full driver name?

    I hope this helps!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:39.
Find Us




Windows 10 Forums