Quantcast
Channel: VMware Communities : All Content - VMware PowerCLI
Viewing all articles
Browse latest Browse all 16717

Invoke-VMScript inside Start-Job/ScriptBlock leaves Powershell process running when execution is done

$
0
0

I have a script that runs Invoke-VMScript from inside a function that starts a new Job with a ScriptBlock and then connects to vCenter with Connect-VIServer and executes Invoke-VMScript. The Invoke-VMScript and the entire function runs fine but I recently noticed that the PowerShell process created by he Start-Job stays running and never exits. When I use this script I start to see a lot of PowerShell processes running in the task manager and they never exit. I have tried various things like disconnecting the VISession after Invoke-VMScript and killing the Start-Job process, but nothing seems to work. Also, in the vSphere client if I look at the open session the sessions remain open.

 

Does anyone know what would cause this and how to kill that process?


Viewing all articles
Browse latest Browse all 16717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>