Automation

 View Only
  • 1.  re-using (accelerating?) PowerCLI connections

    Posted Oct 24, 2019 03:09 PM

    Greetings,

    Is there a way I can re-use an existing vcenter session in a new instance of powershell?

    I have a workflow which launches a new powershell core instance, connects to vcenter, and executes some checks about our systems, run on a schedule of every five minutes.  The powershell instance is terminated each time it finishes executing.

    Thank you kindly,



  • 2.  RE: re-using (accelerating?) PowerCLI connections
    Best Answer

    Posted Oct 24, 2019 03:11 PM

    Use the Session parameter on the Connect-VIServer cmdlet.

    The value to pass can be found in $global:DefaultVIServer.SessionId of an existing connection.



  • 3.  RE: re-using (accelerating?) PowerCLI connections

    Posted Oct 24, 2019 03:13 PM

    Luc you are a treasure.