Icon Error when moving from Universal Dashboard to Powershell Univeral

Getting the follow error message:

Jul 13, 2021 8:51 PM An error occurred: Cannot process argument transformation on parameter ‘Icon’. Cannot create object of type “UniversalDashboard.Models.FontAwesomeIcons”. The id property was not found for the UniversalDashboard.Models.FontAwesomeIcons object. The available property is: [value__ <System.Int32>]
Endpoint: ProvisioningGrid
Session: d47ea06f-44ed-434e-8ada-a64c06ebe9d5
File: C:\ProgramData\UniversalAutomation\Repository\Desktop.ps1
Endpoint Start Line: 257
Endpoint End Line: 281
Stack Trace: at , : line 10
at , : line 3

from the following Code:

$PageProvisioning = New-UDPage -Name "Provisioning" -Content {
        new-udgrid -Id "ProvisioningGrid" -Title "Provisioning" -Headers @("Name", "UserName", "Title", "IDs", "Limited","Active") -Properties @("displayName", "SAMAccountName", "title", "ids", "Limited", "Active") -Endpoint {
                get-aduser -filter * -SearchBase "OU=Provisioning,OU=Active,OU=_Users,DC=Domain,DC=com" -Properties displayName, SAMAccountName, title, employeeID, employeeNumber,universalID  | Sort displayName | foreach { 
                    displayName = $_.displayName
                    SAMAccountName = $_.SAMAccountName
                    title = $_.title
                    ids = $_.employeeID + "/" + $_.employeeNumber + "/" + $_.universalID
                    # Create Button for Moving User to Limited OU
                    Limited = New-UDButton -icon (New-UDIcon -Icon user_slash) -BackgroundColor "#FF5733" -OnClick (
                            New-UDEndpoint -Endpoint {
                                 Show-UDToast -Message ("Moving User to Limited OU: " + $_.displayName) -Duration 4000 -Position center
                                 $_ | Move-ADObject -TargetPath "OU=Limited,OU=Active,OU=_Users,DC=Domain,DC=com" 
                                 Sync-UDElement -Broadcast -Id "ProvisioningGrid"  
                    Active = New-UDButton -icon (New-UDIcon -Icon user_check) -BackgroundColor "#32FF00"  -OnClick {
                                Show-UDToast -Message ("Activating User: " + $_.displayName) -Duration 4000 -Position center
                                ActivateUser -aduser $_
                                Sync-UDElement -Broadcast -Id "ProvisioningGrid" 
                } | Out-UDGridData
        } -AutoRefresh -RefreshInterval 600

I started with

New-UDButton -icon user_slash

and tried

New-UDButton -icon (New-UDIcon -Icon user_slash)

I am not even sure this is the problem in the code.

I have been very frustrated with the conversion process of simple working of Universal Dashboard to over complexities of Universal Powershell.

Thank for help in advance.

Hey Boats -

The new UD has a different Icon name.

New-UDIconButton -Icon (New-UDIcon -Icon UserCheck)

New-UDIconButton -Icon (New-UDIcon -Icon UserSlash)

Anyway, I had similar frustration when I was migrating all of my dashboards to PSU - since you’re already used to how things are build in UD. But once you get the hang of it, the new UD is even better and easier to code.

Yo @cn9ne I was going to suggest that is was possible the icon name didn’t exist. But I tried this the other day (as sadly I uninstalled PSU today :cry: ) using @boats2000 code, and well it worked…? So I didn’t bother posting that suggestion…is it possible you have not got the older framework included. I was running 1.5.12


Yes, I removed old reference to the old framework and loaded with a new one since migration. Again, I believe the issue was with the icon name.

Lastest frame work, latest powershell. Same amount of frustration with Powershell Universal.

I can get some icons to work but not without a lot of trial and error. I can not find help for any commands, intellsense not working powershell or VSCode. No complete documentation found for UD Commandlets (i.e. New-UDDrawer, what are the valid values for -Variant; New-IDIcon -icon (autocomplete of available icons [Currently manually checking Font Awesome website, still no guarantee it will work) Powershell Dashboard was better that sliced bread. Powershell Universal is like burnt toast. (is my frustration showing)

This works but looks nothing like the old menu commandlet.

New-UDDashboard -Title "Desktop Support Dashboard" -Content {

  New-UDDrawer -Variant 'permanent' -Content  {

    New-UDList -children {

        New-UDListItem -Label "Dashboard" -icon (new-udicon -icon columns -size 2x) -OnClick {}

        New-UDListItem -Label "Provisioning" -icon (new-udicon -icon user -size 2x) -OnClick {}

        New-UDListItem -Label "Deprovisioning" -icon (new-udicon -icon user -size 2x) -OnClick {}

        New-UDListItem -Label "Inactive" -icon (new-udicon -icon users -size 2x)  -OnClick {}

        New-UDListItem -Label "Password Expires" -OnClick {}

        New-UDListItem -Label "Connect Accounts" -OnClick {}




Sorry for the frustration, @boats2000.

I think you’ll have a better editing experience if you install the new UD module. It will provide IntelliSense in VS Code.

Install-Module UniversalDashboard 

From there, you’ll have the latest framework cmdlets on your PSModulePath.

As for the icon inconsistency, I can take a look. If icons aren’t working, we have a bug. I’ll open an issue for this.

I’m always open to feedback about examples as well. Please feel free to open issues about features, bugs or documentation omissions or inconsistencies.

Adam @adamdriscoll,

I had only loaded Universal module, a little better now that I have loaded “UniversalDashboard”, but still not does help with the Help.

The website does not reflect the Commandlet the same, consistent or completely.

WEBSITE (List - PowerShell Universal) Example shows -content / API shows -children.
New-UDList -Content {
New-UDListItem -Label ‘Inbox’ -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle ‘New Stuff’
New-UDListItem -Label ‘Drafts’ -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I’m working on "
New-UDListItem -Label ‘Trash’ -Icon (New-UDIcon -Icon trash -Size 3x) -SubTitle ‘Stuff I deleted’
New-UDListItem -Label ‘Spam’ -Icon (New-UDIcon -Icon bug -Size 3x) -SubTitle “Stuff I didn’t want”

Please note helpfile below: missing valid values for Variant or Anchor (or explaination of usage) also look at example where New-UDList shows -content not -children

**get-help new-uddrawer -full **

Creates a new drawer.

New-UDDrawer [[-Id] ] [[-Children] ] [[-Variant] ] [[-Anchor] ] []

Creates a new drawer. A drawer is a navigational component that is typically used for navigating between pages. It can be used with New-UDAppBar to provide a custom nav bar.

The ID of the component. It defaults to a random GUID.

    Required?                    false
    Position?                    1
    Default value                [Guid]::NewGuid()
    Accept pipeline input?       false
    Accept wildcard characters?  false

-Children <ScriptBlock>
    Navgiation controls to show within the drawer. Use New-UDList and New-UDListItem to generate links within the drawer.

    Required?                    false
    Position?                    2
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false

-Variant <String>

    Required?                    false
    Position?                    3
    Default value                temporary
    Accept pipeline input?       false
    Accept wildcard characters?  false

-Anchor <String>

    Required?                    false
    Position?                    4
    Default value                left
    Accept pipeline input?       false
    Accept wildcard characters?  false

    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).



-------------------------- EXAMPLE 1 --------------------------

PS > Creates a custom navbar using New-UDDrawer

$Drawer = New-UDDrawer -Id 'drawer' -Children {
    New-UDList -Content {
        New-UDListItem -Id 'lstHome' -Label 'Home' -OnClick {
            Set-TestData 'Home'
            } -Content {
                New-UDListItem -Id 'lstNested' -Label 'Nested' -OnClick {
                Set-TestData 'Nested'

New-UDElement -Tag 'main' -Content {
    New-UDAppBar -Children { New-UDTypography -Text 'Hello' -Paragraph } -Position relative -Drawer $Drawer

I recently had to rebuild my PC (SSD Failed) that was running my old Powershell Dashboard and rebuilding in the new Powershell Universal has been one hurdle after another. I would also like to see simple navigation return in PowershellUniversal.

$Navigation = New-UDSideNav -Content {
New-UDSideNavItem -Text “AD Dashboard” -PageName “PageMain” -Icon dashboard
New-UDSideNavItem -Text “Provisioning” -PageName “Provisioning” -Icon user_plus
New-UDSideNavItem -Text “DeProvisioning” -PageName “DeProvisioning” -Icon user_minus
New-UDSideNavItem -Text “Inactive” -PageName “Inactive” -Icon user_slash
New-UDSideNavItem -Text “Limited Users” -PageName “PageLimited” -Icon user_alt
New-UDSideNavItem -Text “Connected User” -PageName “ConnectedUser” -Icon drivers_license
New-UDSideNavItem -Text “Password Status” -PageName “PasswordStatus” -Icon drivers_license

$thisTheme = Get-UDTheme DefaultTight
$Dashboard = New-UDDashboard -Title “Active Directory Tasks” -Theme $thisTheme -pages @($PageMain, $PageProvisioning, $PageDeProvisioning, $PageInactive, $PageLimited, $ConnectedUser, $UserPasswordStatus) -NavBarLogo (New-UDImage -Url “https://www.domain.com/s/aelogo.png”) -LoginPage $LoginPage
$Dashboard = New-UDDashboard -Title “Active Directory Tasks” -Theme $thisTheme -pages @($PageMain, $PageProvisioning, $PageDeProvisioning, $PageInactive, $PageLimited, $ConnectedUser, $UserPasswordStatus) -NavBarLogo (New-UDImage -Url “https://www.domain.com/s/logo.png”)

Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Dashboard $Dashboard -Port 10000 -AutoReload -AllowHttpForLogin

I understand documentation is a pain, it is no fun. But we need it. I have watch Don Jones toolmaking video many times and also Jeffrey Snover/Don Jones Microsoft course which shows how the help system was and is integral in creating good powershell tools and in this case Dashboards.

Thanks in advance and for your earlier response.

Chris (boats2000)

Thanks for all the feedback, @boats2000. I understand the issues you are having with help. I’ll set aside some time to line up the in-module help with the online documentation. I appreciate you pointing out where they are lacking.

As for simple navigation, I’ll open an issue for this. I agree that it should be easier.