ps/Modules/Cole.PowerShell.Developer/Public/Expand-Path.ps1
2023-05-30 22:51:22 -07:00

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))
}