Closed mattmcnabb closed 4 years ago
The dashboard should be doing some of this already but the support is pretty limited. I'll take a look and beef this up. If the SCript has defined params we should be discovering them programmatically and allowing input - but it may not be robust enough or simply failing a param check!
My script is pretty simple:
[CmdletBinding()]
param
(
[Parameter()]
[string]
$Domain = (Get-UAVariable -Name "DuckDnsDomain").Value,
[string]
$IPAddress = (irm "https://api.ipify.org"),
[string]
$Token = (Get-UAVariable -Name "DuckDnsApiToken").Value,
[string]
$BaseUri = (Get-UAVariable -Name "DuckDnsBase").Value
)
$Uri = "{0}?domains={1}&token={2}&ip={3}" -f $BaseUri,$Domain,$Token,$IPAddress
Invoke-RestMethod -Method Get -Uri $Uri -Verbose
I just added [CmdletBinding()]
and a [Parameter()]
attribute to see if that might kick off the detection, but I still don't see anything when I run the script - just a confirm button:
Great Example!
Even our SUPER basic "Parameters" test script is having the same problem. The script should be getting analyzed and then the parameters are supposed to be automatically read. That modal should be programmatically showing each param on run, but it is not.
param($Test1, $Test2, $Test3) $Test1; $Test2; $Test3
Fixed in tonight's build.
Please consider adding the capability to specify parameters when running a script ad-hoc. This will support the use case of publishing scripts for a team to run on demand with parameterized input.