internal/functions/validate/Validate-RequestorSettings.ps1
function Validate-RequestorSettings { [CmdletBinding()] Param ( [bool] $allowCustomAssignmentSchedule, [bool] $enableOnBehalfRequestorsToAddAccess, [bool] $enableOnBehalfRequestorsToRemoveAccess, [bool] $enableOnBehalfRequestorsToUpdateAccess, [bool] $enableTargetsToSelfAddAccess, [bool] $enableTargetsToSelfRemoveAccess, [bool] $enableTargetsToSelfUpdateAccess, [object[]] $onBehalfRequestors, [System.Management.Automation.PSCmdlet] $Cmdlet = $PSCmdlet ) begin { $parentResourceName = "accessPackageAssignmentPolicies" } process { if (Test-PSFFunctionInterrupt) { return } $hashtable = @{} foreach ($property in ($PSBoundParameters.GetEnumerator() | Where-Object {$_.Key -ne "Cmdlet"})) { if ($script:supportedResources[$parentResourceName]["validateFunctions"].ContainsKey($property.Key) -and $property.Value) { if ($property.Value.GetType().Name -eq "Object[]") { $validated = @() foreach ($value in $property.Value) { $dummy = $value | ConvertTo-PSFHashtable -Include $($script:supportedResources[$parentResourceName]["validateFunctions"][$property.Key].Parameters.Keys) $validated += & $script:supportedResources[$parentResourceName]["validateFunctions"][$property.Key] @dummy -Cmdlet $Cmdlet } } else { $validated = $property.Value | ConvertTo-PSFHashtable -Include $($script:supportedResources[$parentResourceName]["validateFunctions"][$property.Key].Parameters.Keys) $validated = & $script:supportedResources[$parentResourceName]["validateFunctions"][$property.Key] @validated -Cmdlet $Cmdlet } } else { $validated = $property.Value } $hashtable[$property.Key] = $validated } } end { $hashtable } } |