Hi all,
I’m new to Universal Dashboard, and figuring it all out. I can’t seem to figure out how to start a separate PowerShell script when New-UDInputAction is clicked. Here is my code so far, personal details taken out.
$MyDashboard = New-UDDashboard -Title "Automation Provisioning" -Content {
New-UDInput -Title "Pre-Verify Build" -Id "Form" -Content {
New-UDInputField -Type 'textbox' -Name 'vc' -Placeholder 'vSphere'
New-UDInputField -Type 'textbox' -Name 'cluster' -Placeholder 'Cluster'
New-UDInputField -Type 'textbox' -Name 'template' -Placeholder 'Template'
} -Endpoint {
param($vc, $cluster, $template)
New-UDInputAction -Endpoint {
C:\Users\myuser\Desktop\UDDashboard\pre-VerifyProvision.ps1 -vc $vc -cl $cluster -template $template
}
}
}
$cert = ( Get-ChildItem -Path cert:\LocalMachine\My\############ )
Get-UDDashboard | Stop-UDDashboard
# Enable-UDLogging
# Disable-UDLogging
Start-UDDashboard -Port 8080 -Dashboard $MyDashboard -Certificate $cert #-AutoReload
Calling full path of the other script cause $PSScriptRoot doesn’t work for me for some reason.
Here is the debug:
[Warn] ExecutionService Error executing endpoint script. Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together
or an insufficient number of parameters were provided.
at , : line 11
15:24:54 [Debug] ComponentController ConvertToActionResult() {“Error”:{“message”:“Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.”,“location”:null,“type”:“error”,“id”:null,“refreshInterval”:0,“autoRefresh”:false,“hasCallback”:false}}
Those are the right parameters for my script though. Anyways my project is I already have existing scripts for a project, I’m just trying to use Universal Dashboard to put it all together and more presentable.
As a side question. Can the script output once clicking submit be displayed on another card below the form using Set-UDElement and New-UDElement?
Any help greatly appreciated.