Getting Started with VMware vSphere and vSAN cmdlets
Provides cmdlets for automated administration of the vSphere environment.
Step 1: Connect to Environment
To setup a connection you should use the Connect-VIServer command. Run the code sample below to connect.
Connect-VIServer -Server 10.23.112.235 -Protocol https -User admin -Password pass
Connect-VIServer Server -Credential $myCredentialsObject -Port 1234
Connect-VIServer "Server" -SessionId $sessionId
Connect-VIServer Server
Connect-VIServer "Server" -User user -Password pass -SaveCredentials
Connect-VIServer -Menu
Connect-VIServer "Server" -AllLinked
$oauthCtx = New-VcsOAuthSecurityContext -ApiToken "a3f35067-80b5-44f0-a0bc-e19f2bc17fb7"
$samlCtx = New-VISamlSecurityContext -VCenterServer "Server" -OAuthSecurityContext $oauthCtx
Connect-VIServer -Server "Server" -SamlSecurityContext $samlCtx
Step 2: Try a GET Command
For example when successfully connected you can run the Get-CustomCertificates command.
C:\PS> Get-CustomCertificates