Share via

Powershell-Printers

Brian Marsalia 1 Reputation point
2021-04-19T17:47:32.737+00:00

Good Morning everyone, I am hoping someone can assist me.

I have a script that adds printers on a local domain depending on what location I am in. I have other co workers that use this script as well. The issue I am running into is that depending on the person's computer the driver version is different. I am trying to set a variable that find the first driver with "Lexmark Universal" on the person's computer. Is there a way to set a variable for the first available driver that is located on the computer ? I am trying not to call out each individual version of the driver. Any help would be appreciated.

Thank you

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2021-04-20T06:02:13.887+00:00

    Hi,

    I'm not sure what you mean by "set a variable for the first available driver". If you want to list the installed drivers you can try this

    Get-WindowsDriver -Online -All | Where-Object {$_.ProviderName -match "Lexmark"}  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

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