Mohamed Sahbi
Mohamed Sahbi

Reputation: 1143

ConvertTo-Html wrong output

I want to save the output in the following picture to a file using ConvertTo-Html ps command. Lists and tables of data in a console.

Here is my command:

node index.js -f ..\IT -u 20 -s 0.5 | ConvertTo-Html | Out-File output.htm

and this is the output:

A list of numbers that don't appear in the image above.

What am I doing wrong?

Upvotes: 0

Views: 153

Answers (1)

user6811411
user6811411

Reputation:

If you are after an exact html representation of the console output,
you may be better off with

Get-ConsoleAsHtml.ps1

An alternative is

Console screen grabs in html

Both copy from $host.ui.rawui.GetBufferContents($rec) use a fixed width font and apply colours. So the output can be copied as text from the page and take less space than a picture.

Upvotes: 1

Related Questions