Im using the following code in my API endpoint:
(above loads (for example) credentials to use for the following command
Connect-VIServer -server x -credential $cred
Problem is, every time i need to get VM info, the connect-viserver needs to run, because the login is not global and i cannot reuse get-vm instantly.
Is there a way to pre-load the modules and have the variables and connections exist for the complete environment / api?
Product: PowerShell Universal Version: 1.4.6