VMware Cloud Community
evilensky
Enthusiast
Enthusiast
Jump to solution

re-using (accelerating?) PowerCLI connections

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,

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Use the Session parameter on the Connect-VIServer cmdlet.

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


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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

Use the Session parameter on the Connect-VIServer cmdlet.

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


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

evilensky
Enthusiast
Enthusiast
Jump to solution

Luc you are a treasure.

0 Kudos