mattboren
Expert
Expert

Hello, scbaca-

This "command" is a function that is defined in the environment initialization script that comes with PowerCLI.  The current default location for that script is "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1".

The function Get-VICommand uses the standard PowerShell Get-Command cmdlet and adds the (deprecated) -PSSnapin parameter to return just commands from the VMware PSSnapins that are added to the current PowerShell session.  (Microsoft has replaced -PSSnapin with -Module, it seems, but -PSSnapin still works).

So, you could either run that environment initialization script to get the function defined so that you can use Get-VICommand, or you could just use:

## get all commands from VMware.* PSSnapins in current PowerShell session
Get-Command -Module VMware.*

## get all commands from VMware.* PSSnapins in current PowerShell session with a noun matching VMHost*
Get-Command -Module VMware.* -Noun VMHost*

You can use the other standard params for Get-Command, like -Name, -Noun, and -Verb, to narrow your results.  Enjoy.