Last active
February 10, 2021 00:55
-
-
Save yamanaiyuki/89c4e2d8cfdff6b08f1f96f45c1f4479 to your computer and use it in GitHub Desktop.
KSPのログを可読しやすいようフィルターするPowerShellスクリプト。ただしこのファイルはSJIS(メモ帳ではANSIを選択)で保存し直さないと文字化けします
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$filter = (Read-Host フィルターしたい文字列。全出力なら空のままエンター) | |
#文字コードをUTF-8にする | |
#以下の行と空行を削除する | |
#(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35) | |
#(Filename: C:\buildslave\unity\build\Runtime/Mono/ManagedMonoBehaviourRef.cpp Line: 334) | |
#(Filename: C:\buildslave\unity\build\Modules/Vehicles/WheelCollider.cpp Line: 241) | |
chcp 65001 | |
cd $env:LOCALAPPDATA"Low\Squad\Kerbal Space Program" | |
if($filter) { | |
cat -Encoding UTF8 .\Player.log -wait -tail 10 | ?{ $_ -notlike "(Filename: C:\buildslave\unity\build\*" } | ?{$_ -notmatch "^$|^ $"} | ?{$_ -match $filter} | |
}else{ | |
cat -Encoding UTF8 .\Player.log -wait -tail 10 | ?{ $_ -notlike "(Filename: C:\buildslave\unity\build\*" } | ?{$_ -notmatch "^$|^ $"} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment