I need a powershell script for windows 11 that will install drivers from one location…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
I need a powershell script for windows 11 that will install drivers from one location for all devices in device manager that have a yellow bang
Assistant
Here is a PowerShell script that will install drivers from a specified location for all devices in Device Manager that have a yellow bang indicating missing drivers:
powershell$driverPath = "C:\drivers" Get-WmiObject Win32_PNPEntity | Where-Object {$_.ConfigManagerErrorCode -ne 0} | ForEach-Object { $deviceID = $_.DeviceID $driverFiles = Get-ChildItem -Path $driverPath -Recurse -Include "$deviceID.*" foreach ($driver in $driverFiles) { Write-Host "Installing $($driver.Name) for $($_.Name)" pnputil.exe -i -a $driver.FullName } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.