2022-01-17 Powershell系のコマンド PowerShell ■OS起動とOS停止の時間を知らべる 12が起動で13が停止のID $events = Get-EventLog System $events | ? { ($_.InstanceID -eq "12") -or ($_.InstanceID -eq "13") } | Out-GridView ■テキストファイルをtailしてgrep Get-Content [対象ファイルのフルパス] -wait | Select-String "[grepする文字列]" ■PowerShellのVersionを表示 $PSVersionTable ■適用済みのパッチを表示 Get-HotFix | where { $_.InstalledOn -ne $null } | Out-GridView ■通信ポートとプロセスの状況を確認する netstat -ano ↓実行ファイル名が知りたい場合 netstat -anobv