Product: PowerShell Universal
Version: 3.6.4
Since the Transfer list can contain multiple selections, what would be the best way to validate that one of the selections does not contain the string, [INELIGIBLE]
?
} -OnValidateStep {
$Context = $EventData
if ($Context.CurrentStep -eq 0 -and $Context.Context.OwnedApps.count -eq 0 ) {
New-UDValidationResult -ValidationError 'Please select at least one application to continue'
}
elseif ($Context.CurrentStep -eq 1 -and $Context.Context.OwnedGroups.count -eq 0) {
New-UDValidationResult -ValidationError 'Please select at least one group to continue'
}
elseif ($Context.CurrentStep -eq 1 -and ((($Context.Context.OwnedGroups | ConvertTo-Json) | Out-String) -like '*[INELIGIBLE]*')) {
New-UDValidationResult -ValidationError 'Please remove ineligible groups from your selection'
}