- 追加された行はこの色です。
- 削除された行はこの色です。
- PowerShell/ファイル操作/ファイル検索 ファイル名を文字列で取得 へ行く。
- PowerShell/ファイル操作/ファイル検索 ファイル名を文字列で取得 の差分を削除
* ファイル名を文字列で取得 [#r675068f]
*** 通常はFileInfoオブジェクトで取得する [#gd455033]
PS> dir *.txt
Mode LastWriteTime FileSize Name
---- ------------- -------- ----
-a---- 2018/05/18 5:57 0 B A.txt
-a---- 2018/05/18 5:57 0 B B.txt
** ファイル名を文字列で取得する [#q9fe50c9]
*** -Nameを指定 [#x72255bc]
PS> dir -Name *.txt
A.txt
B.txt
*** selectを使用 [#u6acd101]
PS> dir *.txt | select -ExpandProperty Name
A.txt
B.txt
PS> dir *.txt | select -ExpandProperty FullName
C:\temp\A.txt
C:\temp\B.txt