powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Install-VMHostPatch



NAME
Install-VMHostPatch

SYNOPSIS
Updates the specified hosts.

SYNTAX
Install-VMHostPatch [-VMHost] -HostPath [-Server ] [-RunAsync] [-WhatIf] [-Confir
m] []

Install-VMHostPatch [-VMHost] -WebPath [-Server ] [-RunAsync] [-WhatIf] [-Confirm
] []

Install-VMHostPatch [-VMHost] -LocalPath [-HostUsername ] [-HostPassword g>] [-HostCredential ] [-Server ] [-RunAsync] [-WhatIf] [-Confirm] []


DESCRIPTION
Updates the specified hosts. The cmdlet installs on the host patches that can be located locally, on a web location
, or in a host file system.
When using -LocalPath or -WebPath, the ESX/ESXi host attempts to store the patch contents in its local temporary di
rectory. Because ESXi hosts have not enough free space on their local drives, this cannot apply to large size patc
hes. The best practice for upgrading an ESXi host is to upload the patch contents on the host's datastore and to ru
n Install-VMHostPatch with the HostPath parameter.
Depending on the component to be upgraded, you might have to set the host into a maintenance mode and to restart th
e host or the hostd management service after applying the patch.
This cmdlet is experimental and might be changed or removed in a future release.


PARAMETERS
-VMHost
Specify the hosts you want to update.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-HostPath
Specify a file path on the ESX host to the patches you want to install.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-RunAsync
Indicate that the command returns immediately without waiting for the task to complete. In this mode, the outpu
t of the cmdlet is a Task object. For more information about the -RunAsync parameter run " help About_RunAsync"
in the vSphere PowerCLI console.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
If 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.

Required? false
Position? named
Default value $true
Accept pipeline input? false
Accept wildcard characters? false

-WebPath
Specify the web location of the patches you want to install.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-LocalPath
Specify the local file system path to the patches you want to install.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-HostUsername
Specify the username you want to use to authenticate with the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-HostPassword
Specify the password you want to use to authenticate with the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-HostCredential
Specify the credentials you want to use to authenticate with the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
VMHostPatchResult[]


NOTES


The cmdlet works only on ESX 4.0 and higher versions.

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

C:\PS>Install-VMHostPatch -VMHost $host1,$host2 -LocalPath c:\esx40\patches\ESX400-200906001\metadata.zip -HostUser
name admin -HostPassword pass


Updates ESX servers using a local file. Before running the cmdlet, you must download the patch file locally and ext
ract to a folder. The name of the folder must contain the patch ID (for example, "ESX400-200906001"). Providing cre
dentials when installing a patch from a local path is mandatory.





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

C:\PS>$host | Install-VMHostPatch -WebPath http://myInternalWebServer/esx40/ESX400-200906001/metadata.zip


Upgrades an ESX server using a Web location. Before running the cmdlet, you must download the patch file and extrac
t to a folder that is published on a Web server. The patch URL address must contain the patch ID (for example, http
://myInternalWebServer/esx40/ESX400-200906001/).





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

C:\PS>$datastore = Get-Datastore -Name Datastore

Copy-DatastoreItem c:\temp\ESX400-200906001\

$datastore.DatastoreBrowserPath -Recurse

$host1,$host2 | Install-VMHostPatch -HostPath
/vmfs/volumes/datastore/ESX400-200906001/metadata.zip


Upgrades ESX servers using the -HostPath parameter. First, you must download the patch file and extract its content
s to a temporary folder that is named after the patch ID (for example, c:\temp\ESX400-200906001\). Copy the folder
in the root folder of the Datastore datastore and run Install-VMHostPatch providing the datastore path to the patch
. Note that the datastore path is case-sensitive.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Install-VMHostPatch.html
Get-VMHostPatch