PowerShell – Anzahl Kerne und Sockets

Hier mal ein nützliches Skript zur Anzeige von Anzahl der Kerne und Sockets auf einem Rechner:

function Get-CPUs {
 $processors = get-wmiobject win32_processor

 if (@($processors)[0].NumberOfCores)
 {
 $cores = @($processors).count * @($processors)[0].NumberOfCores
 }
 else
 {
 $cores = @($processors).count
 }
 $sockets = @(@($processors) |
 % {$_.SocketDesignation} |
 select-object -unique).count;

 "Cores: $cores, Sockets: $sockets";
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>