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

Store and Re-use PowerShell Session with PowerCLI Module Loaded and Connected to vCenter Server.

$
0
0

I have a requirement where, I need to execute 3 PowerShell Scripts and each script connects to PowerCLI and then connects to VCenter Server and executes the code.

Ouput of Script-1 is input of Script-2, Output of Script-2 is Input of Script-3.

 

The problem that I am facing is the time taken the to load PowerCLI module in each of these scripts and then again the time taken to Connect to vCenter Server in each script.

All the 3 Scripts execute in sequence, but sometimes they all may run on same server or different servers each.

 

Is there a way to save the PowerShell session (Where the PowerCLI module is loaded and as well the Connection to the vCenter remains intact) created by Script-1, so that the same can be used

by Script-2 and Script-3 ?

 

I know it may sound a bit crazy, but is there a solution or workaround to store the PowerShell session in some object or session variable or file etc ?


Viewing all articles
Browse latest Browse all 175326

Trending Articles



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