Creating HTML Reports With Style
Creating HTML Reports With Style
with Style
Jeff Hicks
[email protected]
@jeffhicks
PowerShell HTML Basics
You must read help and examples for ConvertTo-HTML
Define
Parse
conditional Convert to [xml]$html = $drives | ConvertTo-Html -fragment
HTML and
style as a HTML
insert class
class
Conditional Formatting
<Title>Disk Drive Report</Title>
<style>
body { background-color:#FFFFFF;
font-family:Tahoma;
font-size:12pt; }
td, th { border:1px solid black;
Define border-collapse:collapse;
Parse
conditional Convert to }
HTML and
style as a HTML th { color:white;
insert class background-color:black; }
class
table, tr, td, th { padding: 5px; margin: 0px }
table { margin-left:50px; }
.danger {background-color: red}
.warn {background-color: yellow}
</style>
Conditional Formatting
Convert to base 64
http://jdhitsolutions.com/blog
@JeffHicks
http://gplus.to/jeffhicks