r/PowerShell
•
u/MartinGC94
•
Apr 04 '26
•
1
1
Script Sharing DeviceManager - Module for managing devices and drivers on Windows
I have created a new module which pretty much does anything that Device Manager does but from PowerShell. This IMO has been sorely missing for Windows Server Core because the existing tools (PnpDevice PS module and pnputil.exe) have been missing features or have not been very PS friendly (thanks to pnputil not being a PS module).
The module is open source and can be found here: https://github.com/MartinGC94/DeviceManager
And naturally it has also been published to the gallery so it can be installed with: Install-Module DeviceManager.
The GitHub page already includes some examples, but here's a few more. First 2 examples of things that the existing tools cannot do AFAIK:
Rollback to a previous driver: Get-Device -DeviceClass Display | where Name -EQ "NVIDIA GeForce GT 710" | Undo-DeviceDriverUpdate
Force installing a driver on a device, despite it not being marked as compatible (Useful because Intel arbitrarily blocks consumer NICs from working on Windows Server):
$Driver = Get-DeviceDriver -DeviceClass Net | where Description -EQ 'Intel(R) Ethernet Connection I218-LM' | sort | select -First 1
Get-Device | where Name -EQ "Ethernet Controller" | Install-DeviceDriver -Driver $DriverSomething that surprised me a bit is that the device driver update dialog actually works on Server core, so if you want you can even do it with a mix of PowerShell and GUI like this: Get-Device | where Name -EQ "Ethernet Controller" | Show-DeviceUpdateWizard
Check it out and leave feedback if you want.
View all comments
Show parent comment
12
u/MartinGC94 Apr 04 '26
It's hard to put a number, but I guess 80-90% if we include all features, but it's 100% if we consider features that I'd expect people to care about (I did look at it when I was making this module).
Take
cmdClassesandcmdListClassfor example. These are used to list out class GUIDs/names which I don't see much use for as an end user. However, I use those same APIs internally to add tab completion like:Get-Device -Class <Tab>so it would be trivial for me to add a command to spit that data out if someone requested it.Similarly,
DevConincludes remoting capabilities, but Windows has removed this feature from the OS since Windows 8/2012 + it was somewhat restricted in functionality. I don't have any remoting built in (though PowerShell itself includesInvoke-Commandwhich I suppose could be used).Anyway, here's a list of the commands that I can see in devcon that I don't think I support:
In the case of
cmdDPAddI do support adding drivers to the driverstore, but it will also try to install it because I use a higher level API that does that: https://learn.microsoft.com/en-us/windows/win32/api/newdev/nf-newdev-diinstalldriverw