This is a pretty obscure one, and I haven't been able to find any corroboration, but I can reproduce it easily.
When you use set-vm to change the version of a VM, it normally finishes quickly and spits out the usual VM info chart. However, if you put this into a start-job command, it never finishes if the set-vm version is successful. If the VM is already at the version you try to set it to, it exits properly with an error.
Here's my example script, updatehw.ps1:
Add-PSSnapin *vmware*;
connect-viserver "127.0.0.1" -wa 0
$vm="testvm"
do {
Start-Sleep -s 5
$MyVM = Get - VM -Name $vm
$status = $My.VM.PowerState
}until($status -eq "PoweredOff")
Set-VM "$vm" -version v8 -Confirm:$false
and the command:
Start-Job -ScriptBlock {.\updatehw.ps1}
Can anyone else confirm this and/or provide a work-around?
--Ken