1
경로 예 : 'C : \ 폴 데라 \ folderB \ folderC \ script.ps1'Split-Path
를 사용PowerShell 2 경로에서 폴더 가져 오기?
, 내가 'folderC'를 얻을 수 있어요,하지만 난 방법을 얻을 것 'folderB'?
Split-Path (Split-Path $MyInvocation.MyCommand.Definition -Parent) -Leaf
이렇게하면 folderC가 반환됩니다.