Product: PowerShell Universal
Version: 1.4.6
As you can see, I am attempting a number of different ways to get the PrimaryReviewerID, BackupReviewerID, & InactivityDuration. I am able to retrieve OwnedApps and OwnedGroups (Step 4).
Any ideas?
New-UDPage -Name 'Application Access Reviews. Reviewer & Duration Selection' -Url / -Content {
$colors = Get-Colors
$common = $colors | Where-Object Mode -EQ common
New-UDElement -Tag 'div' -Id 'mainContainer' -Content {
New-UDRow -Columns {
New-UDColumn -LargeSize 8 -Content {
New-UDStyle -Content {
New-UDCard -TitleAlignment 'center' -Content {
New-UDStepper -Steps {
New-UDStep -OnLoad {
New-UDElement -Tag 'div' -Content { "Select one or more apps" }
New-UDTransferList -Id 'OwnedApps' -ClassName 'transfer-list' -Item {
Get-GacAFUserOwnedApp -User 'xxxxxxx-xxxx-xxxx-xxx-c54xxxxxx257' | ForEach-Object {
New-UDTransferListItem -Name $_.displayName -Value $_.appId
}
}
} -Label "Step 1"
New-UDStep -OnLoad {
New-UDElement -Tag 'div' -Content { "Select one or more groups" }
New-UDTransferList -Id 'OwnedGroups' -ClassName 'transfer-list' -Item {
@($EventData.Context.OwnedApps) | ForEach-Object {
Get-GacAFAppAssignment -AppId $_.value | ForEach-Object {
New-UDTransferListItem -Name $_.PrincipalDisplayName -Value $_.PrincipalId
}
}
}
} -Label "Step 2"
New-UDStep -OnLoad {
New-UDElement -Tag 'div' -Content { "Choose Reviewer, Backup Reviewer, and Inactivity Duration" }
New-UDHtml -Markup "<br>"
New-UDAutocomplete -Label "Choose Primary Reviewer" -OnLoadOptions {
Get-GacAFUserDisplayNameTop -WordToComplete $Body -Top 5 | Select-Object -ExpandProperty DisplayName | ConvertTo-Json
} -OnChange {
New-UDTextbox -Disabled -Id 'PrimaryReviewerID' -Label 'PrimaryReviewerID' -Value (Get-GacAFUser -User $Body).Id | ConvertTo-Json
}
New-UDHtml -Markup "<br>"
New-UDAutocomplete -Label "Choose Backup Reviewer" -OnLoadOptions {
Get-GacAFUserDisplayNameTop -WordToComplete $Body -Top 5 | Select-Object -ExpandProperty DisplayName | ConvertTo-Json
} -OnChange {
New-UDTextbox -Disabled -Id 'BackupReviewerID' -Label 'BackupReviewerID' -Value (Get-GacAFUser -User $Body).Id | ConvertTo-Json
}
New-UDHtml -Markup "<br>"
New-UDSelect -Id 'InactivityDuration' -Option {
for ($i = 30; $i -lt 365; $i = $i + 30) {
New-UDSelectOption -Name $i -Value $i
}
} -OnChange {
} -Label 'Choose Inactive Duration'
} -Label "Step 3"
New-UDStep -OnLoad {
New-UDElement -Tag 'div' -Content { 'TEST' }
New-UDTypography -Text ('0:{0} 1:{1} 2:{2} 3:{3} 4:{4}' -f @(
@(@($EventData.Context.OwnedApps) | ForEach-Object { $PSItem.value }) -join ','
@(@($EventData.Context.OwnedGroups) | ForEach-Object { $PSItem.value }) -join ','
@(@($EventData.Context.PrimaryReviewerID)) -join ','
@(@($EventData.Context.BackupReviewerID) | ForEach-Object { $PSItem.value }) -join ','
$($EventData.AutoComplete.InactivityDuration)
)) -Variant h6
} -Label 'Step4'
} -OnFinish {
New-UDElement -Tag 'div' -Id 'result' -Content {
}
}
}
} -Style 'text-align: center;'
}
}
}
}