plaman
Enthusiast
Enthusiast

this is the loop where call the vm and pass the the info to the Job,  i ca not see where it is passing blank, 

$jobs = @()

foreach ($vmName in $vmNames) {

Write-Host " Processing $vmName Vm...." -ForegroundColor Green

$vm = Get-VM -Name $vmName -server $vCentre

$job = Start-Job -Name $vm.Name -ArgumentList $vm.Name -ScriptBlock ${function:Update-VM}

$jobs += $job

}

 

Reply
0 Kudos