Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Multidimensional array with start-job

$
0
0

Hi! I'm trying to improve a script that will read in a CSV file to an array, divide it up to 4 chunks. So I will have 4 arrays and inside each array I have properties for computername, ip addresses and so forth. ($arrComputers[0][56].ComputerName)

So what I want to do is:

# Send 1 chunk array at a time to a Start-Job. 1 chunk consits of 100 computers.

# Read each object,  $arrComputers[index][row].Status ,

# If Status says "OK" don't continue to check, Else continue to fetch info and write back to

$arrComputers[index][row].<property>

So for I've only gotten to 

$Script={
   Param($comp)<Do Check, Read and Write for each computer here>
}

for($i=0;$i -lt 4;$i++)
{
$compCollection[$i] | Start-Job -ScriptBlock $Script -ArgumentList ($compCollection[$i] 
}

I hope I have been clear what I'm trying to do. This is my first time trying it, so wouldn't surprise me if you guys got a better idea how to achieve what I want or what I've done wrong. I'm all ears and also to pointers to guides and such where I can read up more about advanced powershelling. 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>