Send multiple outputs to the same HTML file in Powershell -


trying figure out how convert html multiple service checks:

i have script:

get-service -computername server1 -name *service1* | convertto-html -body "<h2>service 1 check</h2> " -property name,status  get-service  -computername server2 -name *service2* | convertto-html -body "<br><h2>service 2 check</h2> " -property name,status | out-file  c:\servicecheck.htm 

is possible?

may can -

$event = get-eventlog -logname security -newest 100 | convertto-html -fragment  $process = get-process | convertto-html -fragment  convertto-html -body "$event $process" -title "status report" |  out-file c:\statusreport.html 

nb: replace $event , $process service cmdlets.

-fragment [<switchparameter>] generates html table. html, head, title, , body tags omitted.

reference - http://technet.microsoft.com/en-us/magazine/hh127059.aspx


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -