Update module version to 1.0.1 and add new functions for exporting and deploying DSC configuration data

This commit is contained in:
Torsten Brendgen
2026-07-03 11:59:18 +02:00
parent fcbe61902f
commit fb9209456b
9 changed files with 491 additions and 8 deletions

View File

@@ -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]."
}