Please feel free to provide feedback or file bugs here.

PowerShell version of DEVCON.EXE or Device Manager cmdlets

DEVCON.EXE can be used to install, uninstall, enable, disable, configure or query devices (as seen in Device Manager) from the command line. Here is the description:

To get DEVCON.EXE, you have to download the entire Windows Drivers Kit (WDK), which is 803MB in size, and, as I understand it, DEVCON cannot be legally redistributed or shared separately.

It would be good to have a PowerShell cmdlet to replace DEVCON that is either installed by default or available in the PSGallery.

Or just allow DEVCON.EXE to be downloaded separately from the WDK somehow, like through NuGet, PSGallery or anywhere.

Or just allow DEVCON.EXE to be redistributed by third parties.

For example, as far as I know, DEVCON.EXE is the only supported or "clean" way to script the installation of the MS Loopback Adapter.

Thank You!

8 votes
Sign in
Sign in with: Facebook Google
Signed in as (Sign out)

We’ll send you updates on this idea

Jason Fossen shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Sign in with: Facebook Google
Signed in as (Sign out)
  • David McFall commented  ·   ·  Flag as inappropriate

    +1 for an Uninstall-PnpDevice cmdlet. I need to uninstall a network device from system running Windows Server without a gui and it's frustrating that there doesn't seem to be a way to automate this that doesn't involve downloading a non-native utility or hunting in the registry for interface GUIDs.

  • Anthony Wall commented  ·   ·  Flag as inappropriate

    Should this be linked or replaced with a request to add an Uninstall-PnpDevice function to the PnpDevice module? Is it open source so we could contribute this ourselves?

  • Sean Bober commented  ·   ·  Flag as inappropriate

    I currently have a situation where I need to not only remove a particular class of device but also need to delete each class member's associated OEM.inf file. I do not believe that this is possible without devcon.exe

  • Jason Fossen commented  ·   ·  Flag as inappropriate

    Hi J.Keith:

    The PnPDevice module is very useful, but I don't think it allows you to (un)install devices. It only provides cmdlets to query, enable or disable them, so it's not a full replacement for devcon.exe.

    For my particular need, I would like to be able to install the MS Loopback Adapter without devcon.exe, but installing devices using MS or third-party drivers and INF files in general I think would be useful to others, especially for appliances.

    If a new Install-PnpDevice cmdlet were added to the PnpDevice module, that would be great, but personally I think it would be enough to just have devcon.exe and a wrapper PoSh module in the PSGallery available for redistribution (or whatever DLL devcon.exe uses plus the PoSh wrapper, not necessarily devcon.exe itself).


Feedback and Knowledge Base