I have a variable defined containing 1000 objects ($P
) and also have a function that will take pipeline input and add a bunch of stuff to each object in the variable (Add-Data.AccountDetail
). Instead of adding the stuff to each thing coming down the pipe one by one I was hoping that PoshRSJob would allow me to split the object being piped in and add stuff to it in parallel. IE take 5 lots of 200 and then process the adding to each in parallel.
I am not a natural coder but seem to get by, so I'm thankful for your patience and help if this is not clear.
$P = Get-PositionalData -AccountName T2000
$P | Start-RSJob -Name AccountDetail -Throttle 5 -ScriptBlock {
$_ | Add-Data.AccountDetail
}
Get-RSJob | Receive-RSJob
I get the following, but nothing seems to be in the Receive-RSJob
. I am certainly misunderstanding something fundamental here!
Error :
Verbose :
Debug :
Warning :
Progress :
HasMoreData : True
HasErrors : False
Output :
RunspacePoolID : fc217600-123f-4d73-9bcc-d1df6f87f6d8
Completed : False
Batch : fc217600-123f-4d73-9bcc-d1df6f87f6d8
Name : AccountDetail
ID : 169
State : NotStarted
InputObject : @{AccounId=T2000}
InstanceID : 3ba5eeed-d48f-4712-8d32-08f5b12a46a3
Handle : System.Management.Automation.PowerShellAsyncResult
Runspace :
InnerJob : System.Management.Automation.PowerShell
Finished : System.Threading.ManualResetEvent
Command :
$_| Add-Data.AccountDetail