- 追加された行はこの色です。
- 削除された行はこの色です。
* Where-Object [#d02c5140]
** 基本 [#r2c8237c]
Get-ChildItem | Where-Object { $_.Extension -eq '.txt' }
** 省略形 [#z0115cec]
Get-ChildItem | ? { $_.Extension -eq '.txt' }
** さらに省略 [#b74f3c14]
dir | ? Extension -eq '.txt'
** ワイルドカード [#d30704a4]
dir | ? Name -Like '*.txt'
** 正規表現 [#mf432a32]
dir | ? Name -Match '\.txt$'
** 複数条件 [#h0d962b4]
*** OR検索 [#ef790c16]
dir -Recurse | ? { $_.Extension -eq ".jpg" -or $_.Extension -eq ".gif" }
*** AND検索 [#db3009a1]
dir -Recurse | ? { $_.Extension -eq ".txt" -and $_.Length -ne 0 }
** テキストファイル内容の検索 [#h4f02b40]
Select-Stringを使う。
** 参考 [#n0f02be3]
http://technet.microsoft.com/ja-jp/library/dd347549.aspx