(Get-CimInstance -Class win32_quickfixengineering | Where-Object { $_.InstalledOn -gt (Get-Date).AddDays(-120) } | Select-Object -Property HotFixID).HotFixID
Get only values (not title) and put it in to a header
Hi,
I'm using below code to get installed Windows update on a device in the last 120 days.
Get-CimInstance -Class win32_quickfixengineering | Where-Object { $_.InstalledOn -gt (Get-Date).AddDays(-120) } | Select-Object -Property HotFixID
The result is below.
HotFixID
--------
KB4601050
KB4562830
KB4598481
KB4598242
I want to remove the HotFixID title and only get the KB values and put them in to an array.
I appreciate any help to get this working. Thanks in advance.
Windows for business | Windows Server | User experience | PowerShell
-
MotoX80 36,401 Reputation points
2021-05-24T13:19:46.327+00:00
1 additional answer
Sort by: Most helpful
-
Andreas Baumgarten 123.6K Reputation points MVP Volunteer Moderator
2021-05-24T13:34:04.503+00:00 Hi @Arosh Wijepala ,
pleas try this
$a = Get-CimInstance -Class win32_quickfixengineering | Where-Object { $_.InstalledOn -gt (Get-Date).AddDays(-0) } | Select-Object -Property HotFixID $a.GetType() $a.HotFixID $a | Format-Table -HideTableHeaders
$a.GetType()
shows$a
is an array$a.HotfixID
shows just the values
TheFormat-Table -HideTableHeaders
shows the table content without header----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten