Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Created August 5, 2014 09:11
Show Gist options
  • Save sayedihashimi/02e98613efcb7280d706 to your computer and use it in GitHub Desktop.
Save sayedihashimi/02e98613efcb7280d706 to your computer and use it in GitHub Desktop.
PowerShell how to convert a relative path to a full path
# based off of http://mnaoumov.wordpress.com/2013/08/21/powershell-resolve-path-safe/
function Resolve-FullPath{
[cmdletbinding()]
param
(
[Parameter(
Mandatory=$true,
Position=0,
ValueFromPipeline=$true)]
[string] $path
)
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($path)
}
@jijiechen
Copy link

Helps a lot, thank you sir.

@brownbl1
Copy link

Perfect! Thanks.

@kateliev
Copy link

kateliev commented Mar 3, 2021

Perfect! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment