Skip to content

Use Get-CimInstance insteadΒ #3

@paulomorgado

Description

@paulomorgado

I'm not a PowerShell expert, but I've read somewhere on the interwebs that Get-CimInstance should be used instead of Get-WmiObject.

Also, you are loading the entire database and filtering after the fact.

This script will bring only the wanted products and only the wanted columns (I've added Version for further filtering):

 Get-CimInstance -ClassName Win32_Product -Filter 'Name like "%Microsoft .NET Core SDK%"' -Property Name,Version,IdentifyingNumber

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions