Windows PowerShellで追記されるログファイルの末尾を自動的に表示させる

いわゆる UnixやLinuxなどでtail -f コマンドに該当することをWindows Powershellで実現させます。

Get-Content -Path “C:\tmp\MyApplicationLog.txt” -Wait -Last 10 -Encoding “UTF8”

 

-Encoding には適切な文字コードを指定

文字コード表

Microsoft Learn: Build skills that open doors in your career
Gain technical skills through documentation and training, earn certifications and connect with the community

コメント

タイトルとURLをコピーしました