Skip to content

Will PowerShell 6 have Get-HotFix? #2296

Closed

Description

@Liturgist

Is Get-HotFix a Microsoft-only thing?

Activity

  1. RichardSiddaway commented on Sep 19, 2016

    @RichardSiddaway

    Get-Hotfix uses a CIM (WMI) class - root\cimv2\Win32_QuickFixEngineering
    so will only work on systems that have that class available. At the moment that's Windows boxes only

  2. Liturgist commented on Sep 19, 2016

    @Liturgist
    Author

    RichardSiddaway - Thanks for your reply. Is there any plan to include other platforms? I can understand that Apple could respond with support, but am not suggesting that they would. How would Linux distros support such a capability?

  3. added
    Up-for-Grabs
    on Nov 2, 2016
  4. Liturgist commented on Jun 27, 2017

    @Liturgist
    Author

    This is another one that a vendor such as Red Hat, Ubuntu, and/or Apple should pick up.

  5. vexx32 commented on Aug 30, 2018

    @vexx32
    Collaborator

    If this were to be made xplat, I would imagine it would perhaps be best reimplemented as a PSProvider of sort.

  6. ThomasNieto commented on Sep 13, 2019

    @ThomasNieto
    Contributor

    Can we add this cmdlet back for Windows for PowerShell v7 backwards compatibility?

  7. iSazonov commented on Sep 29, 2019

    @iSazonov
    Collaborator

    Steve Lee (@SteveL-MSFT) Please confirm that we can bring the cmdlet back as Windows-only. Or is current intention to use it by a compatibility tool?

  8. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    Let me look into this a bit

  9. removed
    Up-for-Grabs
    on Oct 8, 2019
  10. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    The reason it was missing previously is that it relied on the old WMI .NET APIs which didn't exist in .NET Core 2.x. However, they are back so we can re-enable this cmdlet with some small changes. Working on a PR.

  11. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    So I got it working on my Win10 machine, however it doesn't return anything. This cmdlet basically wraps the WMI query: select * from Win32_QuickFixEngineering, which also doesn't return anything on my Win10 machine when used directly outside of PowerShell.

  12. ThomasNieto commented on Oct 8, 2019

    @ThomasNieto
    Contributor

    Steve Lee (@SteveL-MSFT) that's strange, I can run a Get-CimInstance and get values returned on my Win10 machine on PS 6.2.2 and 7-preview4.

    PS C:\> Get-CimInstance -ClassName Win32_QuickFixEngineering
    
    Source        Description      HotFixID      InstalledBy          InstalledOn
    ------        -----------      --------      -----------          -----------
                  Update           KB4495618     NT AUTHORITY\SYSTEM  6/12/2019 12:00:00 AM
                  Security Update  KB4470788                          3/12/2019 12:00:00 AM
                  Security Update  KB4503308     NT AUTHORITY\SYSTEM  6/12/2019 12:00:00 AM
                  Security Update  KB4504369     NT AUTHORITY\SYSTEM  6/12/2019 12:00:00 AM
                  Security Update  KB4509095     NT AUTHORITY\SYSTEM  8/11/2019 12:00:00 AM
                  Security Update  KB4512577     NT AUTHORITY\SYSTEM  9/27/2019 12:00:00 AM
                  Security Update  KB4516115     NT AUTHORITY\SYSTEM  9/27/2019 12:00:00 AM
                  Security Update  KB4512578     NT AUTHORITY\SYSTEM  9/27/2019 12:00:00 AM
  13. vexx32 commented on Oct 8, 2019

    @vexx32
    Collaborator

    @tnieto88 the key part is:

    This cmdlet basically wraps the WMI query: select * from Win32_QuickFixEngineering, which also doesn't return anything on my Win10 machine when used directly outside of PowerShell.

    In other words, somehow this WMI/CIM class only exists inside PowerShell; the direct .NET APIs for this kind of thing won't work, which doesn't bode well for a binary cmdlet. wmic also can't find it either.

    That's a first for me, Steve Lee (@SteveL-MSFT), has this sort of thing been done before? 😕

  14. ThomasNieto commented on Oct 8, 2019

    @ThomasNieto
    Contributor

    Rain Sallow (/u/ta11ow) (@vexx32) would it be possible to rewrite it to be a cdxml instead of a binary cmdlet to avoid that issue?

  15. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    @tnieto88 let me create a Win10 VM that isn't domain joined in case something is happening there to try it. I don't think it makes sense to rewrite it. The code is pretty simple, just need a system that has instances of that class to test against.

  16. RichardSiddaway commented on Oct 8, 2019

    @RichardSiddaway

    But the class is included in the standard WMI class documentation - https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering

    I've got a script from the Windows 2000 Scripting Guide that uses Win32_QickFixengineering class via VBScript so it should be accessible outside of PowerShell

    In theory it would be possible to produce a CDXML wrapper for the class. I can experiment with that if required

    The Win32\_QuickFixEngineering&\#8194;WMI class represents a small system-wide update, commonly referred to as a quick-fix engineering (QFE) update, applied to the current operating system.
  17. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    It's certainly possible to wrap it in CDXML. Feel free to experiment!

  18. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    On my Win7 VM, the cmdlet works, so I'll add some conditional tests if Win32_QFE returns any instances then submit a PR.

  19. SteveL-MSFT commented on Oct 8, 2019

    @SteveL-MSFT
    Member

    To be clear, this is only re-enabling the cmdlet on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Resolution-FixedWG-Cmdlets

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions