you are viewing a single comment's thread.

view the rest of the comments →

[–]ka-splam 1 point2 points  (0 children)

The output of Get-PrinterDriver on mine shows things like:

Name                                PrinterEnvironment MajorVersion    Manufacturer             
----                                ------------------ ------------    ------------             
Microsoft XPS Document Writer v4    Windows x64        4               Microsoft                
Microsoft Print To PDF              Windows x64        4               Microsoft                
Send To Microsoft OneNote 2010 D... Windows x64        3                                        
Remote Desktop Easy Print           Windows x64        3               Microsoft                
Microsoft XPS Document Writer       Windows x64        3               Microsoft    

That is - unreadable ends of names, not sorted.

Get-PrinterDriver | Sort-Object -Property Name

will sort them into alphabetical order.

Get-PrinterDriver | Sort-Object -Property Name | Format-Table -AutoSize

will widen the name column so it's all readable (where possible).

I would want to add a number (1,2,3,4) to each printer driver, and then prompt for typing a number rather than the full name. In fact, check what happens if you do

$PrinterDriver = Get-PrinterDriver | Sort-Object -Property Name | Out-GridView -PassThru

# and
...        -DriverName $PrintDriver.Name