Install a Printer using PowerShell

Install a Printer using PowerShell

September 13, 2025·Tyler Rasmussen
Tyler Rasmussen

Printer Vectors by Vecteezy

In this post, I want to outline the basic PowerShell commands required to install a printer on a Windows 10/11 host. This won’t go through all of the various conditional statements you should add to verify the installation process, it will just be the core commands to have a printer added.

Add Driver

Lets install the driver.

Pnputil /add-driver "PrinterDriver.inf"
Add-PrinterDriver -Name "Driver Name"

The first command installs the driver into the operating system’s driver store located at %SystemRoot%\System32\DriverStore\FileRepository\.

The second command than copies the driver to %SystemRoot%\System32\spool\drivers which is a directory dedicated for printer related functions.

Driver’s Name

You’ll notice that the second command is looking for the driver’s name rather than the driver’s filename. Unfortunately as the printer is yet to be properly installed, this is difficult to find. My recommendation would be to fully install the driver on a test system first. Once installed, you can then run Get-Printer | Select Name,DriverName to see the driver’s name.

Create Printer Port

Create a printer port. This dictates where the printer is located on the network. I usually just use the IP address as the printer port’s name (this is a common default).

Add-PrinterPort -Name "172.16.70.3" -PrinterHostAddress "172.16.70.3"

Create Printer Object

With all of the various details sorted out, we can now create the actual printer object, seen by users on the system.

Add-Printer -Name "Printer Name" -PortName "172.16.70.3" -DriverName "Driver Name"

If all goes well, you should now see the printer as an option when printing a document.

Duplex & Color (Optional)

Optional, but you can use the following command to specify the duplex mode and whether documents will print in color or black & white by default.

Set-PrintConfiguration -PrinterName "Printer Name" -DuplexingMode TwoSidedLongEdge -Color $true

The accepted values for duplex mode are:

  • OneSided
  • TwoSidedLongEdge (most common)
  • TwoSidedShortEdge

Color is a boolean of either $true or $false.