Skip to content

Instantly share code, notes, and snippets.

@hsimah
Created June 22, 2019 00:53
Show Gist options
  • Save hsimah/69f03a864e8022e8ebf4f2bc2984a667 to your computer and use it in GitHub Desktop.
Save hsimah/69f03a864e8022e8ebf4f2bc2984a667 to your computer and use it in GitHub Desktop.
# Join-Path will handle trailing slashes or lack thereof
Join-Path -Path $Branch -ChildPath $Leaf
# Other useful functions include:
[IO.Path]::GetDirectoryName() # Gets the directory name
[IO.Path]::GetFileName() # Gets the file name
[IO.Path]::GetFileNameWithoutExtension() # Gets the file name sans extension
[IO.Path]::GetExtension() # Gets the file extension including leading .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment