LoginSignup
0

posted at

PowerShellで特定の文字列があるファイルパス一覧を作成したい。

PowerShellで特定の文字列があるファイルパス一覧を作成したい場合、
対象のフォルダでpowrshellを開き下記スクリプトを実行する。

Get-ChildItem -Recurse -Filter "hoge"  | ForEach-Object {$_.FullName} | Out-File "output.txt" 

【解説】
上記のスクリプトを実行するとファイル名に"hoge"が含まれる場合に、
output.txtにフルパスが出力される。

-Recurse 指定をしているのでカレントパスから下位フォルダ全てを検索する。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0