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

@@ -0,0 +1,29 @@
function ConvertTo-ConfigurationDataRelativePath {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true)]
[string]
$BasePath
)
$ResolvedPath = Repair-ConfigurationDataPathEncoding -Path $Path
$ResolvedBasePath = Repair-ConfigurationDataPathEncoding -Path $BasePath
try {
$PathUri = [System.Uri]::new((Resolve-Path -LiteralPath $ResolvedPath).ProviderPath)
$BaseUriPath = [System.IO.Path]::GetFullPath($ResolvedBasePath)
if(-not $BaseUriPath.EndsWith([System.IO.Path]::DirectorySeparatorChar)){
$BaseUriPath += [System.IO.Path]::DirectorySeparatorChar
}
$BaseUri = [System.Uri]::new($BaseUriPath)
return [System.Uri]::UnescapeDataString($BaseUri.MakeRelativeUri($PathUri).ToString()).Replace('/', [System.IO.Path]::DirectorySeparatorChar)
}
catch {
return $ResolvedPath
}
}