Hosted IIS environment
PSU version 5.6.8
I am having issues starting an App and calling a different page based on an IF Else statement. I cannot get a Role match even though when I output the Roles to a table it is there. Also, the if statement has a submit form inside it but that submit dialog appears when the else page is to be displayed. So, it still loads an input box -onsubmit even though it is not part of the else page form.
If ($Roles -contains $LAPSRole){$Navigation = @( New-UDListItem -Label "LAPSLookup" -OnClick { Invoke-UDRedirect -url "/LAPSLookup"}) $Pages = @() $Pages = Get-UDPage -Name 'LAPSLookup'}Else {$Navigation = @(New-UDListItem -Label "Home" -OnClick { Invoke-UDRedirect -url "/Home"})$Pages = @() $Pages = Get-UDPage -Name 'Home'} New-UDApp -Title 'LAPSLookup' -Pages $Pages -Navigation $Navigation
I also tried the bit about using roles for pages.
$Pages = @() $Pages += New-UDPage -Name 'Administrators' -Content { New-UDTypography -Text 'Dashboard for user: $User' } -Role 'Administrator' $Pages += New-UDPage -Name 'Operators' -Content { New-UDTypography -Text 'Dashboard for user: $User' } -Role 'Operator' New-UDApp -Title 'Pages' -Pages $Pages
That did not work either as it does not respect the roles and continues to just whatever page it wants even when i set bogus role values.