Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在生成的 html 文件中,ping 结果的输出被破坏。我希望结果与 $ping 中显示的一样。
$ping = Ping 192.168.1.1
转换为-html -body $ping | 输出文件 ping.html
这有点hack-ish,但试试这个:
$ping = (ping 192.168.1.1) -replace "<", "<" (ConvertTo-Html -Body $ping) -replace "<body>", "<body>`n<pre>" ` -replace "<table>", "</pre>`n<table>" | Out-File "ping.html"