SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


spls
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

spls [2019/07/26 15:56]
sjoerd created
spls [2019/08/09 11:30] (current)
sjoerd
Line 1144: Line 1144:
   
  ##########​ Print the Letter ##########  ##########​ Print the Letter ##########
- # Print document, add local printer by IP address, set as default. G4: 172.25.25.241; G2: 172.25.25.221+ # Print document, add local printer by IP address, set as default. G4: 25.25.25.241; G2: 25.25.25.221
  try{  try{
  if (($splsProcessPrint -eq "​Print"​) -or ($splsProcessPrint -eq "Test Print"​)){  if (($splsProcessPrint -eq "​Print"​) -or ($splsProcessPrint -eq "Test Print"​)){
- Write-host $(__LINE__) "​Printing the Shareholder $splsShareHolderName with ID $splsShareHolderID letter."​ + if ((get-printer | select name,​printerstatus | where {$_.Name -like "​G2*"​}).PrinterStatus -eq "​Normal"​){ 
- $doc.PrintOut() + Write-host $(__LINE__) "​Printing the Shareholder $splsShareHolderName with ID $splsShareHolderID letter."​ 
- start-sleep 10+ $doc.PrintOut() 
 + start-sleep 10 
 + }else{ 
 + Write-host $(__LINE__) "​Printer is not available for $splsShareHolderName with ID $splsShareHolderID letter."​ 
 + ## Add Printer status to logfile 
 + Get-printer | select * 
 + $message = "​$(__LINE__) $date - Printer is not available for $splsShareHolderName with ID $splsShareHolderID letter. The file will still be created in the folder. Please print it manually. Consult the log for more details. " 
 + $message | Out-File $globallog -append 
 + $info += "​$message <​br>"​ 
 + $sendlogfile = $true 
 + }
  }  }
  }  }
spls.txt · Last modified: 2019/08/09 11:30 by sjoerd