Problem:
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> connect-viserver
connect-viserver : The term 'connect-viserver' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ connect-viserver
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (connect-viserver:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Solution:
Run below command to add VMware Snap-in.
Add-PSSnapin "VMware.VimAutomation.Core"
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Add-PSSnapin "VMware.VimAutomation.Core"