ArgumentList parameter to Start-Job Incomplete
Votes from Connect: 15
Original Date Submitted: 5/29/2010 12:09:48 AM
Description:
Contact Information
Handle: Clint B.
Site Name: PowerShell
Feedback ID: 563695
Frequency: Always Happens
Regression: I don't know if this issue existed previously
Problem 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
Product Studio item created by Connect Synchronizer due to creation of feedback ID 563695 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=563695).
Repro Steps:
PS $ gh start-job -parameter argumentlist
-ArgumentList <Object[]>
Specifies the arguments (parameter values) for the script that is specified by the FilePath parameter.
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.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
Expected Results:
Internal BugId: 2556
