To avoid unexpected timeout, you can use Set-PowerCLIConfiguration to modify the vSphere PowerCLI settings for long-running Web tasks.

Verify that you are connected to a vCenter Server system.

1

(Optional) Learn more about what settings you can configure with Set-PowerCLIConfiguration.

Get-Help Set-PowerCLIConfiguration
2

Store the value of the timeout setting for the current session in the $initialTimeout variable.

$initialTimeout = (Get-PowerCLIConfiguration -Scope Session).WebOperationTimeoutSeconds
3

Set the timeout setting for the current session to 30 minutes.

Set-PowerCLIConfiguration -Scope Session -WebOperationTimeoutSeconds 1800000
4

Run your Web task.

For example, run an esxcli command to install a software profile.

$esxcli.software.profile.install("http://mysite.com/publish/proj/index.xml",$null,$null,$null,$null,$null,$true,"proj-version",$null)
5

Revert the timeout setting for the current session to the initial value.

Set-PowerCLIConfiguration -Scope Session -WebOperationTimeoutSeconds $initialTimeout