Update module version to 1.0.1 and add new functions for exporting and deploying DSC configuration data
This commit is contained in:
@@ -10,12 +10,31 @@ function Resolve-ConfigurationDataTemplatePath {
|
||||
$BasePath = (Get-Location).Path
|
||||
)
|
||||
|
||||
$CandidatePath = $Path
|
||||
if(-not [System.IO.Path]::IsPathRooted($CandidatePath)){
|
||||
$CandidatePath = Join-Path -Path $BasePath -ChildPath $CandidatePath
|
||||
$CandidatePaths = @()
|
||||
foreach($CurrentPath in @($Path, (Repair-ConfigurationDataPathEncoding -Path $Path))){
|
||||
if([string]::IsNullOrWhiteSpace($CurrentPath)){
|
||||
continue
|
||||
}
|
||||
|
||||
$CandidatePath = $CurrentPath
|
||||
$CandidateBasePath = Repair-ConfigurationDataPathEncoding -Path $BasePath
|
||||
if(-not [System.IO.Path]::IsPathRooted($CandidatePath)){
|
||||
$CandidatePath = Join-Path -Path $CandidateBasePath -ChildPath $CandidatePath
|
||||
}
|
||||
|
||||
if($CandidatePaths -notcontains $CandidatePath){
|
||||
$CandidatePaths += $CandidatePath
|
||||
}
|
||||
}
|
||||
|
||||
$ResolvedPath = $null
|
||||
foreach($CandidatePath in $CandidatePaths){
|
||||
$ResolvedPath = Resolve-Path -LiteralPath $CandidatePath -ErrorAction SilentlyContinue
|
||||
if($null -ne $ResolvedPath){
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
$ResolvedPath = Resolve-Path -Path $CandidatePath -ErrorAction SilentlyContinue
|
||||
if($null -eq $ResolvedPath){
|
||||
throw "Configuration data template [$Path] was not found. Base path [$BasePath]."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user