PowerShell 7.0.0-preview5ではSelect-Stringコマンドレットにもちょっとした工夫が取り込まれている。Select-Stringコマンドレットは、UNIX系のコマンドで言えばgrepコマンドに相当する機能で、指定したキーワードを含む行だけを抽出する処理を可能にしてくれる。
The Select-String cmdlet uses regular expression matching to search for text patterns in input strings and files. You can use Select-String similar to grep in UNIX or findstr.exe in Windows.
システムの調査や設定ファイルの確認作業で、「この設定、どのXMLファイルに書かれていたかな…?」と、大量のファイルの中から目的の一つを探し出すのに苦労した経験はありませんか?特に、フォルダの階層が深いと、手作業で探すのは絶望的ですよね。
Finds text in an XML string or document. This example gets the alias properties in the Types.ps1xml. For information about this file, see about_Types.ps1xml. The ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する