Last active
February 1, 2019 18:28
-
-
Save tylerapplebaum/0a82343a53c34b6f0d27724154fbfabe to your computer and use it in GitHub Desktop.
Printer Automation Idea for Dave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param( | |
[Parameter(HelpMessage="Specify the path to the CSV file")] | |
[string]$CSVPath, | |
[Parameter(HelpMessage="Specify one of OCHIN's supported drivers")] | |
[ValidateSet("HP LaserJet 4100 Series PCL6", "HP Universal Printing PCL 5 (v5.7.0)", "Kyocera TASKalfa 7551ci", "Sharp MX-3500N", "Xerox Global Print Driver PCL")]$Driver | |
) | |
ForEach ($Printer in $Printers) { | |
C:\Printer_Build\Remote.ps1 -PrinterName $Printer.EPIC_ID -PrintServerName $Printer.Print_Server -QueueName $Printer.Printer_Name -DriverName $Driver -Tray $Printer.Tray_Number -Comment $Printer.Comment -Location $Printer.Location | |
} | |
########## | |
EPIC_ID,Print_Server,Printer_Name,Tray_Number,Comment,Location | |
2010049,mchdps,mchdmcyphmphlox t1,T1,mchdps,McCoy Building Pharmacy - 170 | |
2010050,mchdps,mchdmcyphmphlox t2,T2,mchdps,McCoy Building Pharmacy - 170 | |
########## | |
[CmdletBinding()] | |
param( | |
[Parameter(HelpMessage="Specify the path to the CSV file")] | |
[string]$CSVPath, | |
[Parameter(HelpMessage="Specify one of OCHIN's supported drivers")] | |
[ValidateSet("HP LaserJet 4100 Series PCL6", "HP Universal Printing PCL 5 (v5.7.0)", "Kyocera TASKalfa 7551ci", "Sharp MX-3500N", "Xerox Global Print Driver PCL")]$Driver | |
) | |
Function Tester { | |
ForEach ($Printer in $Printers) { | |
Write-Output $Printer.EPIC_ID | |
Write-Output $Printer.Print_Server | |
Write-Output $Printer.Printer_Name | |
Write-Output $Printer.Tray_Number | |
Write-Output $Printer.Comment | |
Write-Output $Printer.Location | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment