title: Pulling Print Drivers from a Server and Installing them to a Workstation Using Powershell
body: <p><strong>Context:</strong> My ultimate goal is to wake up from print Nightmare. To do this, I plan on creating a script that will be deployed via GPO that installs print drivers and network printers. Below is the test script I'm working with.</p>
  <p><strong>Script:</strong></p>
  <pre><code>pnputil.exe /a &quot;\\j001-hal2010\HP Universal Print Driver\pcl6-x64-7.0.0.24832\hpcu250u.inf&quot;
  Add-PrinterDriver -Name &quot;HP Universal Printing PCL 6&quot; -InfPath &quot;C:\Windows\System32\DriverStore\hpcu250u.inf&quot;
  Add-PrinterPort -Name &quot;TCPPort:10.1.1.193&quot; -PrinterHostAddress &quot;10.1.1.193&quot;
  Add-Printer -DriverName &quot;HP Universal Printing PCL 6&quot; -Name &quot;Cust Service HP Color LaserJet M653&quot; -PortName &quot;TCPPort:10.1.1.193&quot;
  </code></pre>
  <p><strong>Problem:</strong> My issue is that the <code>pnputil.exe /a &quot;\\j001-hal2010\HP Universal Print Driver\pcl6-x64-7.0.0.24832\hpcu250u.inf&quot;</code> comes back with the following error:</p>
  <blockquote>
  <p>Adding the driver package failed : Invalid INF passed as parameter.</p>
  </blockquote>
  <p>When I insert a Wilcard for the INF, I receive the same error:
  <code>pnputil.exe /a &quot;\\j001-hal2010\HP Universal Print Driver\pcl6-x64-7.0.0.24832\*.inf&quot;</code></p>
  <blockquote>
  <p>Adding the driver package failed : Invalid INF passed as parameter.</p>
  <p>Total attempted:              0 Number successfully imported: 0</p>
  </blockquote>
  <p><strong>Resources:</strong></p>
  <p><a href="https://www.pdq.com/blog/using-powershell-to-install-printers/" rel="nofollow noreferrer">https://www.pdq.com/blog/using-powershell-to-install-printers/</a></p>
  <p><a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil-command-syntax" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil-command-syntax</a></p>