Table of contents
ISE
TOC
Collapse the table of content
Expand the table of content

Get-HotFix

JuanPablo Jofre|Last Updated: 11/17/2016
|
2 Contributors

SYNOPSIS

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

SYNTAX

Default (Default)

Get-HotFix [[-Id] <String[]>] [-ComputerName <String[]>] [-Credential <PSCredential>] [<CommonParameters>]

Description

Get-HotFix [-Description <String[]>] [-ComputerName <String[]>] [-Credential <PSCredential>]
 [<CommonParameters>]

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.

EXAMPLES

Example 1: Get all hotfixes on the local computer

PS C:\>Get-HotFix

This command gets all hotfixes on the local computer.

Example 2: Get all hotfixes on multiple computers that start with a search string

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: Create a text file that contain the computer names that are missing a security update

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: Get the most recent hotfix on the local computer

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.

PARAMETERS

-ComputerName

Specifies a remote computer. The default is the local computer.

Type the NetBIOS name, an Internet Protocol (IP) address, or a fully qualified domain name (FQDN) of a remote computer.

This parameter does not rely on Windows PowerShell remoting. You can use the ComputerName parameter of this cmdlet even if your computer is not configured to run remote commands.

Type: String[]
Parameter Sets: (All)
Aliases: CN, __Server, IPAddress

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Credential

Specifies a user account that has permission to perform this action. The default is the current user.

Type a user name, such as User01 or Domain01\User01, or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.

Type: PSCredential
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Description

Specifies the hotfix descriptions that this cmdlet gets. Wildcards are permitted. The default is all hotfixes on the computer.

Type: String[]
Parameter Sets: Description
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Id

Specifies the hotfix IDs that this cmdlet gets. The default is all hotfixes on the computer.

Type: String[]
Parameter Sets: Default
Aliases: HFID

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

None

You cannot pipe input to this cmdlet.

OUTPUTS

System.Management.ManagementObject#root\CIMV2\Win32_QuickFixEngineering

This cmdlet returns objects that represent the hotfixes on the computer.

NOTES

  • This cmdlet uses the Win32_QuickFixEngineering WMI class, which represents small system-wide updates of the operating system. Starting with Windows Vista, this class returns only the updates supplied by Microsoft Windows Installer, Windows Update, Microsoft Update, or Windows Server Update Services. It does not include updates that are supplied by Component Based Servicing (CBS), or other non-hotfix programs or apps. For more information, see the Win32_QuickFixEngineeringhttp://go.microsoft.com/fwlink/?LinkID=145071 class topic in the Microsoft .NET Framework SDK at http://go.microsoft.com/fwlink/?LinkID=145071.

    The output of this cmdlet might be different on different operating systems.

*

Win32_QuickFixEngineering

Get-ComputerRestorePoint

Add-Content

© 2016 Microsoft