$PathIntune = "$Env:Programfiles\Intune"

$PackageName = "Printer"
$PrinterName = "Xerox Versalink C7025 - Vznohradská"
$PrinterDriverName = "Xerox VersaLink C7025 V4 PCL6"

Start-Transcript -Path "$PathIntune\Log\$PackageName-install.log" -Force

$PrinterExist = Get-Printer -Name $PrinterName -ErrorAction SilentlyContinue
if (-not ($PrinterExist)) {
    pnputil.exe /a "drivers\*.inf"
    Add-PrinterDriver -Name $PrinterDriverName -InfPath "C:\Windows\System32\DriverStore\FileRepository\xerox_versalink_c7000_c7020_c7025_c7030_pcl6.inf_amd64_c5154981de99a4c7\Xerox_VersaLink_C7000_C7020_C7025_C7030_PCL6.inf"
    Add-PrinterPort -Name $PrinterName -PrinterHostAddress "10.201.0.121"
    Add-Printer -DriverName $PrinterDriverName -Name $PrinterName -PortName $PrinterName 
}
0

Stop-Transcript
