
Split-Pathを使うことによって、パスから親フォルダやファイル名を取り出すことが出来ます。
構文
Split-Path [-Path] <パス> [-Parent]
Split-Path [-Path] <パス> [-Leaf]
Split-Path [-Path] <パス> [-Qualifier]
Split-Path [-Path] <パス> [-Leaf]
Split-Path [-Path] <パス> [-Qualifier]
親フォルダ
PS C:\> Split-Path "C:\work\image1\eeee.jpg" -Parent C:\work\image1
ファイル名
PS C:\> Split-Path "C:\work\image1\eeee.jpg" -Leaf eeee.jpg
ドライブ名
PS C:\> Split-Path "C:\work\image1\eeee.jpg" -Qualifier C:
スポンサーリンク