Hi,
You may try this.
$someting = @{result1=@();result2=@()}
$test = "a test"
Import-Csv $CSV_file -Delimiter ";" | ForEach-Object -ThrottleLimit 5 -Parallel {
Write-host $using:test
($using:someting).result1 += "some result 1 `n"
($using:someting).result2 += "some result 2 `n"
}
$someting.result1
$someting.result2
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.