PowerShell Logo Small

Get-HotFix



This is the built-in help made by Microsoft for the command 'Get-HotFix', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' 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>] [<CommonParameters>]
Get-HotFix [-Description <string[]>] [-ComputerName <string[]>] [-Credential <PSCredential>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-Hotfix cmdlet gets the hotfixes that have been applied to the local computer or to remote computers by Component-Based Servicing.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=135217
Get-ComputerRestorePoint

REMARKS

<

Examples


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

C:\PS>get-hotfix



Description
-----------
This command gets all hotfixes on the local computer.








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

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



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








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

C:\PS>$a = get-content servers.txt

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



Description
-----------
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 --------------------------

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



Description
-----------
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.