Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – Backup Windows Drivers

Posted on October 21, 2016 By David Kittell

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
    }
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell Windows

Post navigation

Previous post
Next post

Related Posts

Network Connection Configurations

Posted on June 25, 2013October 26, 2015

If you are on Windows Vista/7/8 you will need to create the batch file and then run it as administrator. In the examples below you will need to first know what the connection name is for your network connection(s) When you click on the start menu or Windows key on…

Read More

UNIX Bash – Domain List Get Whois Info

Posted on August 25, 2016September 2, 2016

If you manage a list of domains it’s sometimes helpful to have a script like this to check the information from time to time. I plan to clean this up in time but for now this works. First create a text file like below that has domains in it google.com…

Read More

SQL Statement Validator

Posted on June 28, 2013October 26, 2015

using System.IO; using Microsoft.Data.Schema.ScriptDom; using Microsoft.Data.Schema.ScriptDom.Sql; public List<string> SQLStmtValid(string sql) { TSql100Parser parser = new TSql100Parser(false); IScriptFragment fragment; IList<ParseError> errors; fragment = parser.Parse(new StringReader(sql), out errors); if (errors != null && errors.Count > 0) { List<string> errorList = new List<string>(); foreach (var error in errors) { errorList.Add(error.Message); } return errorList;…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes