18 lines
506 B
PowerShell
18 lines
506 B
PowerShell
function Expand-Path {
|
|
<#
|
|
.SYNOPSIS
|
|
Will ensure we are using the full path. Especially handy with '~/' paths
|
|
|
|
.PARAMETER Path
|
|
The path to be expanded. Typically used with a relative path e.g. ~/.ssh -> C:\Users\<username>\.ssh\
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([string])]
|
|
param
|
|
(
|
|
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
|
|
[string]$Path
|
|
)
|
|
|
|
return ($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path))
|
|
} |