# a style sheet, style.css, should be in the same directory # as the saved html fle. $server=hostname $body="Services Report for "+$server.ToUpper()+"
" $fle="c:\"+$server+"-services.html" write-host "Generating Services Report for "$server.ToUpper() get-service |sort -property status -descending | ConvertTo-HTML ' Name,DisplayName,Status -Title "Service Report" ' -Css "style.css" ' -Body $body | out-fle $fle write-host "Report Generation Complete! Open" $fle "for results."