vSphere PowerCLI Reference



Modifies the vSphere PowerCLI configuration.


Set-PowerCLIConfiguration [-ProxyPolicy <ProxyPolicy>] [-DefaultVIServerMode <DefaultVIServerMode>] [-InvalidCertificateAction <BadCertificateAction>] [-DisplayDeprecationWarnings [<Boolean>]] [-WebOperationTimeoutSeconds <Int32>] [-Scope <ConfigurationScope>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version

Detailed Description

Modifies the vSphere PowerCLI configuration.


NameTypeDescriptionRequired?Pipeline InputDefault Value
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$true
DefaultVIServerModeDefaultVIServerModeChange the server connection mode. The new configuration takes effect immediately after you run the cmdlet. The following values are valid:

- Single - Switching to "single" removes all server connections except the last established one. If no target servers are specified, cmdlets run only on the last connected server.

- Multiple - All servers connected after switching to "multiple" mode are stored together with the current server connection in an array variable. If no target servers are specified, cmdlets run on the servers in the variable.

For more information on default servers, see the description of Connect-VIServer.
DisplayDeprecationWarningsBooleanIndicate whether you want to see warnings about deprecated elements.falsefalse
InvalidCertificateActionBadCertificateActionDefine the action to take when an attempted connection to a server fails due to a certificate error. The following values are valid:

Unset - this is the default value and it acts as a ?Warn? value for Connect-VIServer and as ?Prompt? for ?Connect-CloudServer?.

Prompt - if the server certificate is not trusted the cmdlet will prompt you for a course of action before it continues. There are several options:
Deny - no connection will be established.
Accept for once - accept the connection only for the current PowerCLI session. You will be prompted again if you attempt to connect to the same server from other processes.
Accept Permanently - the action will add this certificate as an exception in the ?SSL Certificate Exceptions? user list. Connect cmdlets will never prompt again what action to take for this particulate certificate and server.
Accept For All Users - same as the above, however the exception will be added to all user lists, which is common for all Windows accounts on the current machine.

Fail - the cmdlet will not establish connection if the certificate is not valid.

Ignore - the cmdlet will establish the connection without taking into account that the certificate is invalid.
Warn - the cmdlet will display a warning saying that the certificate is not valid, the reason why it is not considered valid and then will print additional information about the certificate.

For more information about invalid certificates, run 'Get-Help about_invalid_certificates'.
ProxyPolicyProxyPolicySpecify whether the vSphere PowerCLI uses a system proxy server to connect to the vSphere server. The valid values are NoProxy and UseSystemProxy.falsetrue (ByValue)
ScopeConfigurationScopeSpecify the scope of the setting that you want to modify. The parameter accepts Sesstion, User and All Users Values.
*Session - the setting is valid for the current vSphere PowerCLI session only and overrides any User and All Users settings.
*User - the setting is valid for the current Windows user only, overrides All Users settings, and is applied only if a Session setting cannot be detected.
*All Users - the setting is valid for all users and is applied only if Session and User settings cannot be detected.
WebOperationTimeoutSecondsInt32Define the timeout for web operations. The default value is 300 sec. Set to a negative integer for an infinite operation timeout.falsefalse300
WhatIfSwitchParameterIndicate 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 --------------

Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Scope Session

Modifies the proxy policy of vSphere PowerCLI for the Session scope.

-------------- Example 2 --------------

Set-PowerCLIConfiguration -ProxyPolicy NoProxy -DefaultVIServerMode Single

Changes the default server connection mode and the proxy policy of vSphere PowerCLI for the AllUsers scope.

-------------- Example 3 --------------

Set-PowerCLIConfiguration -DefaultVIServerMode 'Single' -Scope ([VMware.VimAutomation.ViCore.Types.V1.ConfigurationScope]::User -bor [VMware.VimAutomation.ViCore.Types.V1.ConfigurationScope]::AllUsers)

Changes the default server connection mode of vSphere PowerCLI for the User and AllUsers scopes.

Copyright © 1998 - 2012 VMware, Inc. All rights reserved.