Skip to content

Instantly share code, notes, and snippets.

@realslacker
Created February 23, 2019 22:12
Show Gist options
  • Save realslacker/7b86648afbb893d550e1fdbc81f4a760 to your computer and use it in GitHub Desktop.
Save realslacker/7b86648afbb893d550e1fdbc81f4a760 to your computer and use it in GitHub Desktop.
WMI Filters
# filter for server core
$Query = 'SELECT * FROM Win32_OptionalFeature WHERE Caption = "Microsoft-Windows-Server-Gui-Shell-Package-DisplayName" AND InstallState = "2"'
Get-WmiObject -Query $Query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment