Skip to content

Instantly share code, notes, and snippets.

@davidgrenier
Created March 26, 2014 17:11
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 davidgrenier/9788312 to your computer and use it in GitHub Desktop.
Save davidgrenier/9788312 to your computer and use it in GitHub Desktop.
#r "System.Management"
open System.Management
do
use ma = new ManagementObjectSearcher("Select * from Win32_Processor")
for item in ma.Get() do
try
printfn "%A" item.["NumberOfCores"]
with _ -> ()
do
use ma = new ManagementObjectSearcher("Select * from Win32_ComputerSystem")
for item in ma.Get() do
try
printfn "%A" item.["NumberOfLogicalProcessors"]
with _ -> ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment