Prerequisite: Must have PowerShell 5.0 or higher
This will backup all 3rd party drivers in a Windows based computer.
clear if ($PSVersionTable.PSVersion.Major -lt 5) { Write-Output "Your version of PowerShell is not supported please upgrade to 5.0 or higher" } else { $ExportDirectory="$($env:USERPROFILE)\Desktop\DriverBackup" Write-Output "Creating temporary directory for the driver files." New-Item -Path $($ExportDirectory) -ItemType Directory | Out-Null #cd $($ExportDirectory) Write-Output "Creating a text file list of all the drivers" $(Get-WindowsDriver -All -Onlines) | Out-File "$($ExportDirectory)\DriverList.txt" Write-Output "Exporting drivers to $($ExportDirectory)" Export-WindowsDriver -Online -Destination $($ExportDirectory) Write-Output "Archiving files into a zip file" Compress-Archive -Path "$($ExportDirectory)" -CompressionLevel Fastest -DestinationPath "$($env:USERPROFILE)\Desktop\DriverBackup.zip" | Out-Null #cd "$($env:USERPROFILE)\Desktop" Write-Output "Removing temporary directory" Remove-Item -Recurse -Path $ExportDirectory }