Hi All,
I'd like to know if this is possible Using Powershell 2.0 to traverse directory and print files on the client installed printer ?
i got the below powershell script it works great over the shared network drive but how to actually modify and use it to query the content of WebDav folders and then print only the .PDF file extension on the client side (not the server side)
Thanks.
Powershell to traverse the directory
function print-file($file) { begin { function internal-printfile($thefile) { if ($thefile -is [string]) {$filename = $thefile } else { if ($thefile.FullName -is [string] ) { $filename = $THEfile.FullName } } $start = new-object System.Diagnostics.ProcessStartInfo $filename $start.Verb = "print" }
if ($file -ne $null) { $filespecified = $true; internal-printfile $file } } process{if (!$filespecified) { write-Host process ; internal-printfile $_ } } }
dir *.pdf -r | print-file