I'm trying to run a Powershell script that pulls data from an APM device across a date range. However it can take up to 9 hours for a week date range. When I run it in a for loop day by date, it takes 35 minutes:
for($i = 0; $i -lt $dateList.Length-1; $i++){
& "C:\Scripts\Grabber.ps1" -date $dateList[$i] -date2 $dateList[$i+1]
}
I need to optimize that further. I've looked at PoshRSJob and Invoke-Parallel, but I can't seem to get my head around this! I'd appreciate any help, thanks.