After adding a runbook with parameters, I'm unable to start it, either in the Test Pane or as a Job after publishing.
[edit] I should probably add it doesn't matter if I have [CmdletBinding()]
specified or not. [/edit]
The runbook (script) in your screenshot contains a function definition (which takes parameters), but does not ever call the function. Your runbook does not take parameters, the function does. That is why the test pane is showing no parameters.
Try this:
param([string]$Bar)
function test-set {
param([string]$Bar)
"$Bar"
}
test-set -Bar $Bar
My memory of this 'support' was incorrect. As Joe points out, Workflow runbooks require the function declaration, but old-school scripts do not.
Commenting the function func-name { }
bits allows the runbook parameters to be found again..
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.