ArgumentList parameter to Start-Job Incomplete - by ClintB_

Status : 

 


16
0
Sign in
to vote
ID 563695 Comments
Status Active Workarounds
Type Bug Repros 3
Opened 5/28/2010 10:09:35 AM
Access Restriction Public

Description

The -ArgumentList parameter is described as passing arguments 'for the script that is specified by the FilePath parameter', which is true.  But it also specifies the arguments to a scriptblock specified by the ScriptBlock parameter.

Additionally the help says that "Because all of the values that follow the ArgumentList parameter name are interpreted as being values of ArgumentList, the ArgumentList parameter should be the last parameter in the command.", which doesn't appear to be true at all.  For example:

PS $ start-job -ArgumentList "one","two" -ScriptBlock { write-host $args }
PS $ receive-job 2
one two

PS $ start-job -ArgumentList "one","two" -FilePath C:\temp\Test.ps1
PS $ receive-job 4
one two
Sign in to post a comment.