Sophisticated HTML Report


posted by Tobias Weltner
11-10-2008

Downloads: 688
File size: 726 B
Views: 3,498

Embed
Sophisticated HTML Report
  1. $head = @' 
  2. <style> 
  3. BODY{font-family:Verdana; background-color:lightblue;} 
  4. TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;} 
  5. TH{font-size:1.3em; border-width: 1px;padding: 2px;border-style: solid;border-color: black;background-color:#FFCCCC} 
  6. TD{border-width: 1px;padding: 2px;border-style: solid;border-color: black;background-color:yellow} 
  7. </style> 
  8. '
  9. $header = "<H1>Reporting Running Software</H1>" 
  10. $title = "Example HTML Output" 
  11.  
  12. Get-Process | Sort-Object Company | Where-Object { $_.Product -ne $null  } | Select-Object Company, Product, FileVersion | ConvertTo-HTML -head $head -body $header -title $title | Out-File $env:temp\report.htm 
  13. & "$env:temp\report.htm" 
Use ConvertTo-HTML to create colorful and stylish HTML reports by adding a few HTML styles.
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.