Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Created August 5, 2014 09:11
Show Gist options
  • Select an option

  • Save sayedihashimi/02e98613efcb7280d706 to your computer and use it in GitHub Desktop.

Select an option

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)
}
@brownbl1
Copy link
Copy Markdown

Perfect! Thanks.

@kateliev
Copy link
Copy Markdown

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