I'm trying to create a vast number of contacts in 365 using a script and would like to run parallel jobs to speed it up, I built a loop inside a job and tested it worked using the following inside the loop to make sure it could extract the correct variables from the CSV.
Powershell
$name=$c1.displaynameNew-Item-Path"C:\Temp\Output"-Name"$name"-ItemType"file"
Now when I attempt to run the loop with the commands in the title as below
Powershell
Connect-MsolService-cred$UserCredential
Powershell
$contacts=Import-Csv"C:\temp\testgal.csv"Start-Job-NameLoop-ScriptBlock{param([pscustomobject[]]$contacts,[System.Management.Automation.PSCredential[]]$UserCredential)$session2=New-PSSession-ConfigurationNameMicrosoft.Exchange-ConnectionUrihttps://outlook.office365.com/powershell-liveid-Credential$UserCredential...