< Back
Install-VMHostPatch
Post
NAME Install-VMHostPatch
SYNOPSIS
This cmdlet updates the specified hosts.
SYNTAX
Install-VMHostPatch [-VMHost] <VMHost[]> [-HostCredential <PSCredential>] [-HostPassword <SecureString>]
[-HostUsername <String>] -LocalPath <String[]> [-RunAsync] [-Server <VIServer[]>] [-Confirm] [-WhatIf]
[<CommonParameters>]
Install-VMHostPatch [-VMHost] <VMHost[]> -HostPath <String[]> [-RunAsync] [-Server <VIServer[]>] [-Confirm]
[-WhatIf] [<CommonParameters>]
Install-VMHostPatch [-VMHost] <VMHost[]> [-RunAsync] [-Server <VIServer[]>] -WebPath <String[]> [-Confirm]
[-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet updates the specified hosts. The cmdlet installs patches on the host. The patches that can be located
locally, on a Web location, or in a host file system. When using the LocalPath or WebPath parameters, the ESX/ESXi
host attempts to store the patch contents in its local temporary directory. Because ESXi hosts might not have
enough free space on their local drives, this cannot apply to large size patches. The best practice for upgrading
an ESXi host is to upload the patch contents on the host's datastore and to run Install-VMHostPatch with the
HostPath parameter. If you want to install patches packaged in a ZIP archive, you must extract them and use one of
the HostPatch, LocalPath, or WebPath parameters. If you use the HostPath parameter, you must extract each patch to
a temporary folder that is named after the patch ID (for example, c:\\temp\\ESX400-200906001\\), and copy the folder
in the root folder of a datastore. Note that the datastore path is case-sensitive. If you use the LocalPath
parameter, you must extract each patch to a folder. The name of the folder must contain the patch ID (for example,
"ESX400-200906001"). If you use the WebPath parameter, you must extract each patch 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/). Depending on the component to be upgraded, you might have to
set the host into a maintenance mode and to restart the host or the hostd management service after applying the
patch.
PARAMETERS
-HostCredential <PSCredential>
Specifies a PSCredential object that contains credentials for authenticating with the host.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-HostPassword <SecureString>
Specifies the password you want to use to authenticate with the host.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-HostPath <String[]>
Specifies a file path on the ESX/ESXi host to the patches you want to install.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-HostUsername <String>
Specifies the username you want to use to authenticate with the host.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-LocalPath <String[]>
Specifies the local file system path to the patches you want to install. Providing credentials when installing
a patch from a local path is mandatory.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-RunAsync [<SwitchParameter>]
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the
output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help
About_RunAsync" in the VMware PowerCLI console.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-VMHost <VMHost[]>
Specifies the hosts you want to update.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? true
-WebPath <String[]>
Specifies the Web location of the patches you want to install.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
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
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
One or more VMHostPatchResult objects
NOTES
The cmdlet works only on ESX 4.1 and later.
-------------------------- Example 1 --------------------------
Install-VMHostPatch -VMHost $vmhost1,$vmhost2 -LocalPath c:\\esx40\\patches\\ESX400-200906001\\metadata.zip
-HostUsername admin -HostPassword pass
Updates ESX servers using a local file. Before running the cmdlet, you must download the patch file locally and
extract to a folder. The name of the folder must contain the patch ID (for example, "ESX400-200906001"). Providing
credentials when installing a patch from a local path is mandatory.
-------------------------- Example 2 --------------------------
$vmhost | Install-VMHostPatch -WebPath http://myInternalWebServer/esx40/ESX400 ... tadata.zip
Upgrades an ESX server using a Web location. Before running the cmdlet, you must download the patch file and
extract it 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 --------------------------
$datastore = Get-Datastore -Name Datastore
Copy-DatastoreItem c:\\temp\\ESX400-200906001\\
$datastore.DatastoreBrowserPath -Recurse
$vmhost1,$vmhost2 | 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
contents 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: https://code.vmware.com/doc/preview?id= ... Patch.html
Get-VMHostPatch
SYNOPSIS
This cmdlet updates the specified hosts.
SYNTAX
Install-VMHostPatch [-VMHost] <VMHost[]> [-HostCredential <PSCredential>] [-HostPassword <SecureString>]
[-HostUsername <String>] -LocalPath <String[]> [-RunAsync] [-Server <VIServer[]>] [-Confirm] [-WhatIf]
[<CommonParameters>]
Install-VMHostPatch [-VMHost] <VMHost[]> -HostPath <String[]> [-RunAsync] [-Server <VIServer[]>] [-Confirm]
[-WhatIf] [<CommonParameters>]
Install-VMHostPatch [-VMHost] <VMHost[]> [-RunAsync] [-Server <VIServer[]>] -WebPath <String[]> [-Confirm]
[-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet updates the specified hosts. The cmdlet installs patches on the host. The patches that can be located
locally, on a Web location, or in a host file system. When using the LocalPath or WebPath parameters, the ESX/ESXi
host attempts to store the patch contents in its local temporary directory. Because ESXi hosts might not have
enough free space on their local drives, this cannot apply to large size patches. The best practice for upgrading
an ESXi host is to upload the patch contents on the host's datastore and to run Install-VMHostPatch with the
HostPath parameter. If you want to install patches packaged in a ZIP archive, you must extract them and use one of
the HostPatch, LocalPath, or WebPath parameters. If you use the HostPath parameter, you must extract each patch to
a temporary folder that is named after the patch ID (for example, c:\\temp\\ESX400-200906001\\), and copy the folder
in the root folder of a datastore. Note that the datastore path is case-sensitive. If you use the LocalPath
parameter, you must extract each patch to a folder. The name of the folder must contain the patch ID (for example,
"ESX400-200906001"). If you use the WebPath parameter, you must extract each patch 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/). Depending on the component to be upgraded, you might have to
set the host into a maintenance mode and to restart the host or the hostd management service after applying the
patch.
PARAMETERS
-HostCredential <PSCredential>
Specifies a PSCredential object that contains credentials for authenticating with the host.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-HostPassword <SecureString>
Specifies the password you want to use to authenticate with the host.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-HostPath <String[]>
Specifies a file path on the ESX/ESXi host to the patches you want to install.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-HostUsername <String>
Specifies the username you want to use to authenticate with the host.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-LocalPath <String[]>
Specifies the local file system path to the patches you want to install. Providing credentials when installing
a patch from a local path is mandatory.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-RunAsync [<SwitchParameter>]
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the
output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help
About_RunAsync" in the VMware PowerCLI console.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-VMHost <VMHost[]>
Specifies the hosts you want to update.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? true
-WebPath <String[]>
Specifies the Web location of the patches you want to install.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
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
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
One or more VMHostPatchResult objects
NOTES
The cmdlet works only on ESX 4.1 and later.
-------------------------- Example 1 --------------------------
Install-VMHostPatch -VMHost $vmhost1,$vmhost2 -LocalPath c:\\esx40\\patches\\ESX400-200906001\\metadata.zip
-HostUsername admin -HostPassword pass
Updates ESX servers using a local file. Before running the cmdlet, you must download the patch file locally and
extract to a folder. The name of the folder must contain the patch ID (for example, "ESX400-200906001"). Providing
credentials when installing a patch from a local path is mandatory.
-------------------------- Example 2 --------------------------
$vmhost | Install-VMHostPatch -WebPath http://myInternalWebServer/esx40/ESX400 ... tadata.zip
Upgrades an ESX server using a Web location. Before running the cmdlet, you must download the patch file and
extract it 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 --------------------------
$datastore = Get-Datastore -Name Datastore
Copy-DatastoreItem c:\\temp\\ESX400-200906001\\
$datastore.DatastoreBrowserPath -Recurse
$vmhost1,$vmhost2 | 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
contents 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: https://code.vmware.com/doc/preview?id= ... Patch.html
Get-VMHostPatch