Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Created February 13, 2011 02:41
Show Gist options
  • Save jstangroome/824371 to your computer and use it in GitHub Desktop.
Save jstangroome/824371 to your computer and use it in GitHub Desktop.
Converts relative paths to absolute paths but does not require the path to exist.
function Get-AbsolutePath {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string[]]
$Path
)
process {
$Path | ForEach-Object {
$PSCmdlet.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment