Se7en
Se7en

Reputation: 443

Filter Hardware Printers | Get-Printer cmdlet | PowerShell

The cmdlet Get-Printer retrieves a list of printers installed on a computer.

The cmdlet also shows software printers (eg Microsoft Print to PDF) that I want to exclude.

Is there a way to filter hardware printers 🖨️?

Upvotes: 0

Views: 983

Answers (1)

Dilly B
Dilly B

Reputation: 1472

By Combining select-string and -notmatch operator you can achieve this. Also please try to add what you have tried to get desired results. Here is a sample for you

Get-Printer | Where-Object {$_.Name | Select-String -notmatch "Fax","Microsoft"}

Upvotes: 2

Related Questions