Example 2: Script containing New-TpmsObjDriver for printer driver installation
Description
Defines a model for printer driver installation (or uninstallation). The model is represented by a container that predefines all printer drivers including their processor architecture support in one variable.
Afterwards, this model can be used to define the target machine using New-TpmsObjApplyAgent and to perform the driver installation process using Start-TpmsApplyByAgent.
Requirements: The driver repository has been set up using Set-TpmsDriverRepositoryOptions and printer drivers have been uploaded to the repository using Import-TpmsDriverArchive.
Note! Please also refer to the section Connecting printers to ThinPrint Ports.
Syntax
New-TpmsObjDriver -Name <string> [-Architecture <architecture>]
Parameter | Description |
-Name | printer driver name |
-Architecture | printer driver’s processor architecture: X86 | X64 | IA64 Note: This parameter is mandatory for target machines running Windows Server 2008 x86 SP2. On these machines, the installation of driver and printer object must be done one after another (1st driver installation, 2nd printer installation). |
Example 1: cmdlet usage
The following example defines the model for the three printer drivers HP Universal Printing PCL 6, KONICA MINOLTA Universal PCL and Lexmark Universal.
$drivers = @() $driver_a = New-TpmsObjDriver -Name "HP Universal Printing PCL 6" -Architecture X86,X64 $driver_b = New-TpmsObjDriver -Name "KONICA MINOLTA Universal PCL" -Architecture X64 $driver_c = New-TpmsObjDriver -Name "Lexmark Universal" -Architecture X64 $drivers += $driver_a $drivers += $driver_b $drivers += $driver_c $drivers
Example 2: Script containing New-TpmsObjDriver for printer driver installation
The following script uses the printer driver repository to install two printer drivers, specified in $drivers.
For this purpose, the printer drivers must be uploaded beforehand to the repository, using Import-TpmsDriverArchive.
$drivers = @() $driver_a = New-TpmsObjDriver -Name "PCL6 Driver for Universal Print" -Architecture X64 $driver_b = New-TpmsObjDriver -Name "Canon Generic PCL6 Driver" -Architecture X64 $drivers += $driver_a $drivers += $driver_b $srva = New-TpmsObjApplyAgent -Name "cps47.ourdomain.local" -Port 5050 -Drivers ($drivers) Start-TpmsApplyByAgent -Action Deploy -Servers ($srva) | Format-TpmsDispatch
Start-TpmsApplyByAgent -Action Deploy installs the drivers on the target machine and -Action Remove deletes them.