Install a printer driver via powershell script

HinW 20 Reputation points
2023-02-13T08:46:56.59+00:00

I would like a PowerShell script that can install a printer driver.

I have a INF file stored in C:\temp\hpPrinter\autorun.inf

I tried below line of code in powershell but get an error saying that.

Code:

$infPath = 'C:\temp\hpPrinter\autorun.inf'

pnputil.exe -i -a $infPath

Error:

Microsoft PnP Utility

Adding driver package: autorun.inf

Failed to add driver package: The third-party INF does not contain digital signature information.

Total driver packages: 1

Added driver packages: 0

Thanks

Windows for business Windows Server User experience PowerShell
{count} votes

3 answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2023-02-13T10:35:32.3+00:00

    Hi @HinW ,

    maybe the cmdlet Add-PrinterDriver is helpful to get this done: Add-PrinterDriver


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Limitless Technology 44,746 Reputation points
    2023-02-14T16:48:26.6466667+00:00

    Double post

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.