Very new to Powershell Universal ...as in got it installed this week. We are still using an unlicensed version until I can prove out that it can do all that we need done. The first thing I'm working on is an APP that will collect parameters to be fed via Invoke-PSUScript to an automation Script.
I am figuring that part out fairly well.
What I can’t figure out is how to organize the actual app webpage.
My example dummy script so far
New-UDApp -Content {
New-UDSelect -ID "Number" -Label 'Number' -Option {
New-UDSelectOption -Name "One" -Value 1
New-UDSelectOption -Name "Two" -Value 2
New-UDSelectOption -Name "Three" -Value 3
}
New-UDSelect -ID "word" -Label 'word' -Option {
New-UDSelectOption -Name "One" -Value "Hello"
New-UDSelectOption -Name "Two" -Value "GoodBye"
New-UDSelectOption -Name "Three" -Value "No one is home"
}
New-UDButton -Text "Run Script" -OnClick {
$value = (Get-UDElement -ID "Number").value
$value2 = (Get-UDElement -ID "word").value
Invoke-PSUScript -Name "test.ps1" -value $value -word $value2 -Integrated -Wait
} -ShowLoading
}
So in this case when i “view app” it just stacks Number / Word / Run Script (click button) next to each other.
I assume there has to be a way that I could say place "Number in top left of page, Word in top right and ‘Run Script’ click bottom in bottom left.
How do you say where things go rather than just letting them stack up next to each other?
Hey @AnonymousUser, There are a lot of ways to order elements on a page.
For your use case, I suggest using new-UDform.
docs.powershelluniversal.com
It automatically stacks elements in a column and has a built-in “run button.”
If you need more control, the next step is udstacks and UDgrid.
I suggest starting with new-udstack, as it is the simplest in my opinion.
Feel free to reach out if you have more questions