PowerShell Logo Small

Get-HotFix



This is the built-in help made by Microsoft for the command 'Get-HotFix', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets the hotfixes that have been applied to the local and remote computers.

SYNTAX


Get-HotFix [[-Id] [<String[]>]] [-ComputerName [<String[]>]] [-Credential [<PSCredential>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore |
Suspend}] [-InformationVariable [<System.String]>]] [<CommonParameters>]
Get-HotFix [-ComputerName [<String[]>]] [-Credential [<PSCredential>]] [-Description [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore
| Suspend}] [-InformationVariable [<System.String]>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-Hotfix cmdlet gets hotfixes (also called updates) that have been installed on either the local computer (or on specified remote computers) by Windows Update,
Microsoft Update, or Windows Server Update Services; the cmdlet also gets hotfixes or updates that have been installed manually by users.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=290494
Get-ComputerRestorePoint

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>get-hotfix



This command gets all hotfixes on the local computer.










-------------------------- EXAMPLE 2 --------------------------

PS C:\>get-hotfix -description Security* -computername Server01, Server02 -cred Server01\admin01



This command gets all hotfixes on the Server01 and Server02 computers that have a description that begins with "Security".










-------------------------- EXAMPLE 3 --------------------------

PS C:\>$a = get-content servers.txt
PS C:\>$a | foreach { if (!(get-hotfix -id KB957095 -computername $_)) { add-content $_ -path Missing-kb953631.txt }}



The commands in this example create a text file listing the names of computers that are missing a security update.

The commands use the Get-Hotfix cmdlet to get the KB957095 security update on all of the computers whose names are listed in the Servers.txt file.

If a computer does not have the update, the Add-Content cmdlet writes the computer name in the Missing-KB953631.txt file.










-------------------------- EXAMPLE 4 --------------------------

PS C:\>(get-hotfix | sort installedon)[-1]



This command gets the most recent hotfix on the computer.

It gets the hotfixes, sorts them by the value of the InstalledOn property, and then it uses array notation to select the last item in the array.