ConvertTo-HTML错误输出

时间:2019-03-19 10:41:29

标签: powershell

我想使用ConvertTo-Html ps命令将下图中的输出保存到文件中。 Lists and tables of data in a console.

这是我的命令:

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

这是输出:

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

我在做什么错了?

1 个答案:

答案 0 :(得分:2)

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.