initial Commit

This commit is contained in:
Torsten Brendgen
2026-06-27 00:36:04 +02:00
commit 4b83abc7f2
27 changed files with 1702 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
function Resolve-ConfigurationDataLocalizedText {
[CmdletBinding()]
Param(
[AllowNull()]
$Value,
[AllowNull()]
[string]
$DefaultValue
)
if($null -eq $Value){
return $DefaultValue
}
if($Value -is [string]){
if([string]::IsNullOrWhiteSpace($Value)){
return $DefaultValue
}
return $Value
}
if(-not (Test-ConfigurationDataMap -Value $Value)){
return [string]$Value
}
$CultureNames = @(
[System.Globalization.CultureInfo]::CurrentUICulture.Name,
[System.Globalization.CultureInfo]::CurrentCulture.Name,
"en-US",
"de-DE",
"en",
"de"
) | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | Select-Object -Unique
foreach($CultureName in $CultureNames){
if(Test-ConfigurationDataMapContainsKey -Map $Value -Key $CultureName){
return [string](Get-ConfigurationDataMapValue -Map $Value -Key $CultureName)
}
}
foreach($Entry in $Value.GetEnumerator()){
if($null -ne $Entry.Value -and -not [string]::IsNullOrWhiteSpace([string]$Entry.Value)){
return [string]$Entry.Value
}
}
return $DefaultValue
}