Get-PowerCLIContext
This cmdlet retrieves the VMware PowerCLI execution context which you can use to simplify the use of PowerCLI in PowerShell runspaces. The PowerCLI execution context includes the imported VMware PowerCLI modules and their established connections.When you use VMware PowerCLI in PowerShell runspaces you have two options.The first option is to import your connections manually, for example, a vCenter Server system connection, and pass them to the corresponding cmdlets using the Server parameter.The second option is to use the Get-PowerCLIContext () cmdlet to retrieve VMware PowerCLI execution context and then use the [Use-PowerCLIContext]()cmdlet prior to using VMware PowerCLI cmdlets in the new PowerShell runspace.
Syntax
Output
VMware.VimAutomation.Common.Types.V1.ExecutionContext.PowerCliContext
Examples
Example 1
Retrieves the current VMware PowerCLI context into the $context variable.
Example 2
Retrieves the current PowerCLI execution context and initializes each new PowerShell runspace created by ForEach-Object -Parallel.
Related Commands