PowerCLI Reference



This cmdlet closes the connection to a vCloud Air server.


Disconnect-PIServer [[-Server] <PIServer[]>] [-User <String[]>] [-Force] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version

Detailed Description

This cmdlet closes the connection to the vCloud Air servers specified by the -Server and -User parameters.

When no servers and no user name are specified, and if there is only one connected server in $DefaultPIServers variable, this server is disconnected. If there is no connected server, the cmdlet throws a terminating error.
When no servers are specified and a user name is specified, the cmdlet tries to find a connection to the vCloud Air server with this user name and if found, disconnects it. If no such connection is found, the cmdlet throws a terminating error.

This functionality is using the reference counting mechanism. For more information about the mechanism, see Connect-PIServer.

When there are no more active connections to the server it gets disconnected and then it is removed from the $DefaultPIServers variable. For more information about this variable, see Connect-PIServer.

If -Force is specified, the server is disconnected even if there is more than one connection to it.


NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerPIServer[]Specifies the vCloud Air servers you want to disconnect from.falsetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
ForceSwitchParameterSpecifies that you want to remove all existing connections to the specified servers.falsefalse
UserString[]Specifies the user you want to disconnect from vCloud Air servers.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type




-------------- Example 1 --------------

$myConnection = Connect-PIServer -User 'user@mail.com' -Password 'user_password'
Disconnect-PIServer $myConnection -Confirm:$false

Disconnects the specified vCloud Air connection without asking for confirmation.

Copyright © VMware, Inc. All rights reserved.