Hi All, been reading here for a while and first post. We bought a PSU license so I can present my scripts to non-tech users via browser. However, after playing with unlicensed PSU on my local machine, I’m having trouble doing… really anything. PSU is running behind IIS on Windows Server 2019: I am a +20-yr Linux guy, so be gentle.
I have a Simple Dashboard with 2 cards on it, in the code below I’m only concerned about the 2nd one. Issues are as follows:
- Whenever I open the Dashboard, I am prompted to enter a 10-digit phone number. I want the Dashboard to open and allow me to interact with either card.
- When I do submit a value, I get “Cannot process argument transformation on parameter ‘OnSubmit’. Cannot convert the “” value of type “System.String” to type “UniversalDashboard.Models.Endpoint”.”
Clearly, I am not “getting” PSU yet, and would appreciate any help.
$Pages = @()
$Pages += New-UDPage -Name 'Telco' -LoadTitle { "Telco" } -Url ../telco -HeaderColor 'black' -HeaderBackgroundColor 'white' -Content {
New-UDParagraph -Text "Telco Resources"
New-UDParagraph -Text "You can created a Switched Number Translation, check or change CNAM, and more."
New-UDRow {
New-UDColumn -Size 12 {
New-UDLayout -Columns 2 -Content {
New-UDCard -Title "Create a Switched Number Translation" -Content {
New-UDTypography -Text "Enter the 10-digit number you wish to forward, and the 10-digit DESTINATION number"
New-UDColumn -SmallSize 6 -LargeSize 6 -Content {
New-UDTextbox -Mask "(000) 000-0000" -Label "Number to Forward" -Id 'numinput' }
New-UDColumn -SmallSize 6 -LargeSize 6 -Content {
New-UDTextbox -Mask "(000) 000-0000"-Label "Destination number" -Id 'destinput' }
}
New-UDCard -Title "Check for a Switched Number Translation" -Content {
New-UDForm -Content {
New-UDTypography -Text "Enter the 10-digit number you wish to check."
New-UDColumn -SmallSize 6 -LargeSize 6 -Content {
New-UDTextbox -Mask "(000) 000-0000" -Label "Number to Check" -Id 'checksntnum' }
-OnValidate {
$FormContent = $EventData
if ($FormContent.checksntnum -eq $null -or $FormContent.checksntnum -eq ''){
New-UDFormValidationResult -ValidationError "A 10-digit number is required"
}
else {
New-UDFormValidationResult -Valid
} -OnSubmit {
Invoke-PSUScript -Name 'Check SNT.ps1' -checksntnum $EventData.checksntnum
Show-UDToast -Message "Cool"
}
}
}
}
}
}
}
} -NavigationLayout permanent
New-UDDashboard -Theme $Theme -Title "Tools" -Pages $Pages
Product: PowerShell Universal
Version: 3.5.5