1
Pfad Beispiel: 'C: \ ordnerA \ ordnerB \ FolderC \ script.ps1'PowerShell 2 Ordner aus Pfad abrufen?
Mit Split-Path
, ich bin in der Lage 'FolderC' zu bekommen, aber wie würde ich 'ordnerB'?
Split-Path (Split-Path $MyInvocation.MyCommand.Definition -Parent) -Leaf
Dies gibt folderC zurück.