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,27 @@
function Assert-ConfigurationDataParameterAllowedValue {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
$Definition,
[AllowNull()]
$Value
)
if(-not (Test-ConfigurationDataMapContainsKey -Map $Definition -Key "AllowedValues")){
return
}
$AllowedValues = @(Get-ConfigurationDataMapValue -Map $Definition -Key "AllowedValues")
if($AllowedValues.Count -eq 0){
return
}
if($AllowedValues -notcontains $Value){
throw "Parameter [$Name] value [$Value] is not allowed. Allowed values are: $($AllowedValues -join ', ')."
}
}