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.
9
u/fosf0r Apr 04 '26
Oh snap, ... do you know how much parity you have with devcon.exe ? https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
Replacing devcon.exe with your PowerShell kit would be so ideal!
16
u/Longjumping_Music572 Apr 04 '26
This is interesting.. I'm commenting to have more people. Take a look at it and give more insight.
Yes, I'm real. I'm not a bot. I'm just autistic as f***. God do I hate it.
6
u/Not_Freddie_Mercury Apr 04 '26
I do manage devices and drivers separately with PWSH, so this intrigues me a lot. Will try and test it with our workstations, particularly the previous driver rollback, which should be handy. Thank you!
1
u/jborean93 Apr 06 '26
Nice work, I was always intrigued by creating a module for this but was always put off by the weird Win32 API that surrounds it. Never had the full confidence I was actually using it correctly but glad to see someone like yourself creating this.
1
u/danhof1 Apr 07 '26
This is something Windows admins have needed for years. Device Manager GUI is fine until you're trying to manage driver updates across hundreds of machines.
3
u/[deleted] Apr 05 '26
[removed] — view removed comment