PowerShell Printer Driver Installation

The following PowerShell script performs an automated Windows printer driver installation. If the driver and / or port already exist they will be deleted and re-installed / re-created respectively.

The .ps1 code is presented below; I have also provided a link to the HP driver installation files. The code has been tested and works on Windows 10/11.

The HP Universal Printer Driver has been used here as an example, but the code has been written so that it may be easily modified for other makes and models of printer.

Knock yourself out! ;-)