how can i run this as one job and not one host at a time? I dont see a runasync option
$vmhosts = get-vmhost -name (get-content esxhosts.txt)
foreach ($vmhost in $vmhosts) {
get-vmhost $vmhost | get-advancesetting -name "Uservars.ESXiShelltimeout" | set-advancedsetting -value "0" -confirm:$false
get-vmhostservice -vmhost $vmhost | ? {$_.key -eq "TSM-SSH"} | restart-vmhostservice -confirm:$false
}