PowerShell – Is hyperthreading enabled?

Today I found myself in a situation where I needed to figure out if hyperthreading was enabled (something to do with SQL licensing), on a whole bunch of hosts.
Here’s a section of the code I used. Hope you find it useful 🙂