Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* ファイル名を文字列で取得 [#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
終了行:
* ファイル名を文字列で取得 [#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
ページ名: