Are there Powershell cmdlets that install and remove Windows drivers?

前端 未结 3 631
天涯浪人
天涯浪人 2021-02-10 04:15

Note: For this question, when I refer to \"Windows drivers\" I mean .inf and associated files which can otherwise be installed by right-clicking the .inf and clicking \"Inst

3条回答
  •  失恋的感觉
    2021-02-10 04:50

    There is a PowerShell module named DeviceManagement, installable from the PowerShell Gallery via Install-Module, which contains the Install-DeviceDriver cmdlet. Example:

    Install-Module -Name DeviceManagement -Force
    Install-DeviceDriver -InfFilePath C:\Drivers\LAN\acmelan.inf
    Get-Device | Where-Object Name -like 'ACME Network Adapter*' | Select-Object Name,DriverProvider,DriverVersion,DriverDescription,HasProblem
    

提交回复
热议问题