How to pass Multiple Variables as Arguments to a Script using Start-job.
Start-Job -Name "$jobName" -filepath $TestTool -ArgumentList $compare1
how to retrieve this argument values (of $arg1 and $arg2) in a script TestTool.ps1?
Rgds Naveen
How to pass Multiple Variables as Arguments to a Script using Start-job.
Start-Job -Name "$jobName" -filepath $TestTool -ArgumentList $compare1
how to retrieve this argument values (of $arg1 and $arg2) in a script TestTool.ps1?
Rgds Naveen
PS>Start-Job -Name test -ArgumentList @("hello","word") -FilePath \\server\share\test.ps1
在 test.ps1 中只是回显 $args var
$args
结果 :
PS>Receive-Job test -keep
hello
word
http://technet.microsoft.com/en-us/library/hh849698.aspx
“因为 ArgumentList 参数名称后面的所有值都被解释为 ArgumentList 的值,所以 ArgumentList 参数应该是命令中的最后一个参数。”
所以我猜想是这样的:
... -ArgumentList $arg1 $arg2
应该管用?