Install all drivers in folder – automagically

Specify the folder which contains all the drivers you wish to have installed. Adjust the -recurse option as needed.

1
2
3
4
5
6
$driversFolder = "C:\xtraDrivers"
$driversCollection = (Get-ChildItem -Path $driversFolder -Filter "*.inf" -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Fullname)
ForEach($driver In $driversCollection){
    # Add and install driver package
    pnputil.exe -i -a $driver
}

Leave a Reply

Your email address will not be published. Required fields are marked *