LucD
Leadership
Leadership

Also, if the $vm variable is not defined inside your Start-Job script, you will have to use the using: qualifier.
The Start-Job creates a new PS environment, your current local variables are not known in that environment.

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

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos