Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Using the "Button - Start-Job" control set in powershell studio, I am trying to pass multiple arguments to a job. I have a working script using one argument, but it seems to fail when I try to pass multiple arguments to it. Example given below using just one argument;
In the jobscript, for the "Param", you have in your example "$Arg1" and "$Arg2", wouldn't that have to be the actual names of the arguments you listed in the "ArgumentList", in your example "$Path" and "$SearchFilter"? Or would literally "$Arg1" and "$Arg2" work?
No. The list is applied in the order of the arguments in the "Param" statement. THe passed list should be the same types, order and number as the Param list.
The Param statement can use any names you like and should use names that are usefule and informative in the context of the scriptblock or function.
Note that a scriptblock is just a simple function without a name. A simple function is just a scriptblock with a name. THis does not completely apply to "Advanced functions".
Variables $Arg1 and $Arg2 will be substitute by the Argumentlist in the order you place your other variables:
Arg1 , Arg2 , ... (more Arguments).
ArgumentList = ($Path, $SearchFilter)
This topic is 4 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.