Hi,
I don't use jobs yet and I don't know how they work. But I got this to work as expected (I think):
Start-Job -ScriptBlock { # Add PSSnapins Add-PSSnapin VMware.VimAutomation.Core Add-PSSnapin VMware.VimAutomation.Vds Add-PSSnapin VMware.VimAutomation.License Add-PSSnapin VMware.DeployAutomation Add-PSSnapin VMware.ImageBuilder Add-PSSnapin VMware.VimAutomation.Cloud $task = Connect-CIServer YOURSERVER -user USERNAME -password PASSWORD -wa 0 -ea 0 Get-CIvApp "Test CIvApp" exit }
Then I waited for it to finish:
Get-Job 23 | fl
Once I saw:
JobStateInfo : Completed Finished : System.Threading.ManualResetEvent InstanceId : 905c99b0-3771-4ea0-9711-f14db2009916 Id : 23 Name : Job23 ChildJobs : {Job24}
I ran this: Get-Job 23 | Receive-Job
Name Enabled InMaintenanceMode Owner ---- ------- ----------------- ----- Test CIvAPP True False system
Do you get the same result? I also got Get-CIvApp "Test CIvApp" | get-civm "MachineName" to return the info.
Cheers,
DeanH