Creating HTML Reports Get-Process |ConvertTo-Html | Set-Content -Path process.html

seen from United States
seen from United States

seen from United States

seen from United States

seen from United States

seen from Japan

seen from Australia
seen from China
seen from Italy

seen from United States
seen from United States

seen from Malaysia

seen from United States
seen from Türkiye
seen from T1

seen from Malaysia

seen from United States

seen from Australia
seen from Ukraine

seen from United States
Creating HTML Reports Get-Process |ConvertTo-Html | Set-Content -Path process.html

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
PowerShellで改行コードを指定してファイル出力するには
この年末、普段は別の方法でやってた作業で「この年末はPowerShellでやってみよ」と思いやってみることに。 やることは普通にShift-JISのテキストファイル作成なんですが、改行コードのみ「LF」にする必要がある、というものです。
Out-Fileコマンドレットを使うのだが
文字列の改行コードは「`n」を指定しておけば簡単ではある。たとえば、以下のような感じ。
# $linesになにか文字列がたくさん入ってるとする $data = @() $lines | ForEach-Object { $data += $_ } $d = $data -Join "`n" $d | Out-File -FilePath "aaa.txt" -Encoding default
だがこの方法だと最後の行がLFにならず、最後にCrLfがついてしまう。
どうすればいいか?
「LF」を直接書き出してやればいいのでは、ということなんですが「どうやって?」 バイト列として書き出してやる方法を見かけました。最後のところを次のようにします。
[byte[]][char[]]$d | Set-Content -Path "aaa.txt" -Encoding Byte
これで最終行の末尾もLFになります。
さて、何が楽しいんだっけ・・・いや、レガシーなシステムともこれで付き合っていけますね!