176k views
1 vote
using Get-Hotfix, display a list of installed hotfixes. Then extend the expression to sort the list by the installation date, and display on the installation date, user who installed the hotfix, and the hotfix ID. Remember that the column headers shown in a command's default output aren't necessarily the real property names- you need to look up the real property names to be sure.

1 Answer

2 votes

Final answer:

To display a list of installed hotfixes sorted by installation date and to include the installation date, user, and hotfix ID, use the Get-Hotfix cmdlet piped into Select-Object to choose the relevant properties, then pipe to Sort-Object to sort the list.

Step-by-step explanation:

In PowerShell, the Get-Hotfix cmdlet is used to retrieve a list of installed hotfixes on a computer. To display just the installation date, user who installed the hotfix, and the hotfix ID, you should first get the properties you want using Get-Hotfix, and then pipe the results to the Select-Object cmdlet, followed by Sort-Object to sort the results by the installation date.

The command to execute this will look like the following:

Get-Hotfix | Select-Object -Property InstalledOn, InstalledBy, HotFixID | Sort-Object -Property InstalledOn

This command will output a list sorted by the InstalledOn date. Please note that sometimes the InstalledOn property may not be populated for all hotfixes due to the way the hotfix information is registered in the system. To ensure accuracy of data, it is recommended to verify the property names, such as InstalledBy and InstalledOn, by using Get-Member cmdlet in PowerShell.

User Micah Yoder
by
7.4k points