I didn’t test this but this should give you the general idea.
New-UDDashboard -Title ‘Home’ -theme $theme -Content {
New-UDAppBar -Position fixed -Children {
New-UDGrid -Container -Content {
New-UDGrid -Item -ExtraSmallSize 1 -Content {
New-UDImage -Id “logoImage” -URL “/themes/small.png”
}
New-UDGrid -Item -ExtraSmallSize 11 -Content {
New-UDElement -Id “logoText” -Tag ‘h1’ -Content { “Home” }
}
}
}
New-UDDynamic -Id 'background' -Content {
if ($session:DevolutionsVaults -eq $null) {
Import-Module RemoteDesktopManager.PowerShellModule
$session:DevolutionsVaults = Get-RDMVault #This is the line that causes the issue!
Sync-UDElement -Id 'content'
}
}
New-UDDynamic -Id 'content' -Content {
if ($session:DevolutionsVaults -eq $null) {
New-UDBackdrop -Id ‘backdrop’ -Content {
New-UDTypography -id ‘backdroptext’ -Text “Loading Devolutions Data…” -Variant h2
} -Open
}
else {
#New-UDTabs -RenderOnActive -Tabs {
# foreach ($Devolutions_Tab in (Get-ChildItem “$UDScriptRoot\Tabs” -Recurse -filter *.ps1)) {
# New-UDTab -Text $Devolutions_Tab.name.split(’.’)[0] -Content {. $Devolutions_Tab.fullname}
# }
#}
}
}
} -DefaultTheme dark -Stylesheets @("/themes/theme.css")