Powered by GeSHi

Source code for showprnh.ps1

(view source code of showprnh.ps1 as plain text)

  1. write-host
  2. write-host "ShowPrnH.ps1,  Version 1.01"
  3. write-host "Show available printers in HTML"
  4. write-host "Written by Rob van der Woude"
  5. write-host "http://www.robvanderwoude.com"
  6. write-host
  7.  
  8. get-wmiobject -class Win32_Printer | convertto-html Name,Default,Network,PortName,DriverName,ServerName,ShareName -head "<title>All printers available on $env:computername</title>`n<style type=`"text/css`">`nbody { padding: 8px; line-height: 1.33 }`ntable { border-style: ridge }`ntd, th { padding: 10px; border-style: dotted; border-width: 1px }`nth { font-weight: bolder; text-align: center }`n</style>" | out-file -FilePath "showprnh.html" -Encoding "ASCII"
  9. invoke-item "showprnh.html"
  10.