25 lines
680 B
PowerShell
25 lines
680 B
PowerShell
function Resolve-ConfigurationDataTemplatePath {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]
|
|
$Path,
|
|
|
|
[Parameter(Mandatory=$false)]
|
|
[string]
|
|
$BasePath = (Get-Location).Path
|
|
)
|
|
|
|
$CandidatePath = $Path
|
|
if(-not [System.IO.Path]::IsPathRooted($CandidatePath)){
|
|
$CandidatePath = Join-Path -Path $BasePath -ChildPath $CandidatePath
|
|
}
|
|
|
|
$ResolvedPath = Resolve-Path -Path $CandidatePath -ErrorAction SilentlyContinue
|
|
if($null -eq $ResolvedPath){
|
|
throw "Configuration data template [$Path] was not found. Base path [$BasePath]."
|
|
}
|
|
|
|
return $ResolvedPath.ProviderPath
|
|
}
|