PowerShell has the Split-Path cmdlet that provides the leaf and parent of a path. But what if you’re splitting paths and need one or paths at a higher level.
Consider the path
PS> $path = 'C:ScriptsHyperVAdminOptimize-VMDisks.ps1'
Its just… Read the full text.