While manually I can copy-paste the KB of an update and apply it through
Get-WindowsUpdate -KBArticleID KBxxxxxx1 -Install
there is no way to automatize this within a script (like the one used in my previous post).
How to reference the KB or the Title properties of such objects? May this be a module-related issue or a PowerShell-related issue?
Note: I am using Windows Powershell 5.1 (run as Administrator). On PowerShell 7.4 (as Administrator) Get-WindowsUpdate produces no output at all (even if the -Verbose option shows Found [2] Updates in post search criteria).
Please pipe the output of Get-WindowsUpdate to Get-Member and post that output here. Get-WindowsUpdate | Get-Member
EDIT: https://github.com/mgajda83/PSWindowsUpdate/blob/main/PSWindowsUpdate/PSWindowsUpdate.Format.ps1xml
We can see in the project’s repo that they’re using a format file to control the output of Get-WindowsUpdate to format it as a table, even though it displays 5 properties which PS would normally format as a list.
My guess is they’re also renaming some of the properties for that table display. Piping it to Get-Member (gm for short) should tell you what properties are there and their names.
well color me confused. Based on the output from Get-Member you should absolutely be able to call those properties by name with that “dot” method you were using.
I might have to install the module and take a look.
Installed the module on a Windows 11 VM (running Atlas OS). The object claims to be a ComObject, but when I do Get-Member it shows the same NoteProperties you have.
But, I can access the properties
I’ll have to try it on a different Windows machine that’s not Atlas OS.
Thanks for all your attempts. Don’t worry, don’t install it again. Probably the behaviour of Get-WindowsUpdate is quite random and it depends on the system or the shell itself (in PowerShell 7.4 I get an empty object, which however has non empty fields Name and KB!). I am on Windows 11 on a physical machine.
Even if it’s not optimal, I can still access those properties with the workaround in the previous post.