Skip to content

Instantly share code, notes, and snippets.

@mrbodean
Created April 16, 2020 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrbodean/cc55d33c37a9ce0cf2e8851c2fc30223 to your computer and use it in GitHub Desktop.
Save mrbodean/cc55d33c37a9ce0cf2e8851c2fc30223 to your computer and use it in GitHub Desktop.
$TypeQuery = sc.exe query winmgmt|Select-String -Pattern "TYPE" -SimpleMatch
$type = $TypeQuery.ToString().Trim().Split(':')[1].trim().split(' ')[0]
$type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment