Monthly Archive


Split-Path serendipity

I’ve used Split-Path and its associated cmdlet Join-Path a lot when working with file system paths. Something I read today started me asking if it would work with URLs


It does:


£> Split-Path -Path '' -Leaf

£> Split-Path -Path '' -Parent


£> Split-Path -Path '' -NoQualifier

£> Split-Path -Path '' -Qualifier


The –Resolve parameter won’t work because its not a file system path but if you need to play with URLs then could be useful.


Just for completeness Join-Path won’t work with URLs because its attempting to resolve the file path

Leave a Reply