0

I have a powershell workflow script as below:

workflow mytest{
    param($param1,$param2,$param3)
    //code
}

mytest $param1,$param2,$param3

Issue here is all the three params were received as array in $param1.

1
  • 5
    Remove the commata in your command line. The delimiter for different parameters is a whitespace / space charachter. Commented Jan 27, 2020 at 9:11

2 Answers 2

1

Type your params

Workflow Test-Runbook
{
  Param
  (
   [Parameter(Mandatory=<$True | $False>]
   [Type]$<ParameterName>,

   [Parameter(Mandatory=<$True | $False>]
   [Type]$<ParameterName>
  )
  <Commands>
}

https://learn.microsoft.com/fr-fr/system-center/sma/overview-powershell-workflows?view=sc-sma-2019

Sign up to request clarification or add additional context in comments.

Comments

1

All you're doing is passing an array to $param1. Powershell parameters always work that way. \\code is not a comment.

workflow mytest{
    param($param1,$param2,$param3)
    "param1 $param1  param2 $param2  param3 $param3"
}

mytest 1 2 3

param1 1  param2 2  param3 3

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.