Categories

Split-Path & UNC

split-path works with with UNC paths as well as normal paths

 

PS> $path = "\\UNCserver\TFSBuilds\componenet\v11.1\XS11.1\XS11.1_11.1.0.35"
PS> Split-Path -Path $path -Parent
\\UNCserver\TFSBuilds\componenet\v11.1\XS11.1

 

PS> Split-Path -Path (get-location) -Parent
C:\scripts

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>