Created
August 5, 2014 09:11
-
-
Save sayedihashimi/02e98613efcb7280d706 to your computer and use it in GitHub Desktop.
PowerShell how to convert a relative path to a full path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect! Thanks.