1

Export to HTML from Win7 PowerShell v2 I am trying to run several checks on different settings and print them out in an easy to read format. I'm using Win7 PowerShell V2 I pulled all this from a website and it works when I have tables:

$a = "<style>"
$a = $a + "BODY{background-color:peachpuff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:palegoldenrod}"
$a = $a + "</style>"

$Variable
$VariableHTML = ConvertTo-HTML -head $a -body "<H2>Title I want</H2>"

$VariableHTML > C:\PoSH\My_Exported_HTML.html

My main issue is my $variable is no longer a table. It is one word Pass/Fail. I would like to have a title on one line, definition on the second line, and the result smaller and on the third line.

1 Answer 1

1

I found my answer on Wikipedia https://en.wikipedia.org/wiki/HTML

$VariableHTML = $Variable | ConvertTo-HTML -head $a -body "<H1>Header One</H1> <H2>Header Two</H2> <H3>Header Three</H3> <p>Paragraph<p/>"

I wanted to be able to add additional headers (though I didn't know what they were called) and a small caption line (paragraph).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.