Connect-Vcs

This cmdlet establishes a connection to a Cloud Services server. The cmdlet requires an OAuth security context in order to authenticate the user. If you want to specify an API token directly, use the ApiToken parameter.

Syntax

[-ApiToken  <SecureString>]
[-NotDefault]
[-SaveApiToken]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
ApiToken
SecureString named Specifies the API token you want to use for authentication with the VMware Cloud Services server. The token is obtained from the VMware Cloud Services web portal.
optional
NotDefault
SwitchParameter named Specifies that you do not want to save the specified servers as default servers (the $global:defaultVcsServers PowerShell variable).
optional
SaveApiToken
SwitchParameter named Indicates that the API token that you use for establishing the server session is saved to a local credential store and can be used automatically when connecting again to the same server.

-Menu
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Menu
SwitchParameter named Indicates that you want to select a connection server from a list of recently connected servers. If the Menu parameter is set to $true, the cmdlet retrieves a list of the last visited servers and enters a nested command prompt, so that you can select a server from the list.

-OAuthSecurityContext  <OAuth2SecurityContext>
[-NotDefault]
[-Server  <String[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
OAuthSecurityContext
OAuth2SecurityContext named Specifies the OAuth security context that you can use to authenticate the user. For more information about security contexts, see the about_security_context article (about_security_context.html) and the [New-VcsOAuthSecurityContext cmdlet](New-VcsOAuthSecurityContext.md).
optional
NotDefault
SwitchParameter named Specifies that you do not want to save the specified servers as default servers (the $global:defaultVcsServers PowerShell variable).
optional
Server
String[] named Specifies the IP address or the DNS name of the VMware managed cloud service. If not specified, the cmdlet assumes that you are connecting to the public commercial instance and the default value of `console.cloud.vmware.com` is used.

Output

Examples


Example 1

Connect-Vcs -ApiToken $apiToken

Connects to a VMware Cloud Services server.

Example 2

Connect-Vcs -ApiToken $script:apiToken -SaveApiToken

Connects to a VMware Cloud Services server by specifying the related secure connection token and saving it for later use.

Example 3

$oauthSecurityContext = New-VcsOAuthSecurityContext -ApiToken $script:apiToken
Connect-Vcs -OAuthSecurityContext $oauthSecurityContext

Connects to a VMware Cloud Services server by specifying an OAuth security context. In this case, you can create it by using the API token.

Example 4

$oauthSecurityContext = New-VcsOAuthSecurityContext -VcsServer "console.cloud.vmware.com" -ApiToken $script:apiToken
Connect-Vcs -Server "console.cloud.vmware.com" -OAuthSecurityContext $oauthSecurityContext

Connects to a VMware Cloud Services server by explicitly specifying the host name of the VMware Cloud Services and the VMware Cloud Services server for the commercial instance. If you want to use a different instance, you can find the corresponding host names in the Developer Center section of the web portal.

Related Commands

Feedback

Was this page helpful?