Some days ago I wrote about taking the leap and start using CIM instead of the good, old Get-WmiObject. I wrote the CIM function template as a result of some WMI functions that I decided to rewrite. Today I give you the first of them; Get-Cpu.

The function is rather simple, as a good function is supposed to be. It queries computers using CIM and returns an object with processor (CPU) information about the target computer.

To be able to translate the CPU family integer code into something a bit more user friendly, I created a separate function for this, so the Get-CpuFamily function is needed for Get-Cpu to work correctly. On of the reasons I decided to write a separate function for this, is that I needed the same code in another WMI function I have. Re-usability is king!

function Get-Cpu {
<#
.SYNOPSIS
Get processor information from one or more computers.
.DESCRIPTION
This function uses CIM to query one or more computer for processor information.
It will first try to connect using 'WSMAN' protocol, but will fall back to using 'DCOM' if
this fails.
.EXAMPLE
Get-Cpu
Will query the local computer for processor information.
.EXAMPLE
Get-Cpu Server01 -Credential domain/user01
Will try to query 'Server01' with the credentials of 'domain/user01'.
.OUTPUTS
PSObject
.LINK
http://msdn.microsoft.com/en-us/library/aa394373%28v=vs.85%29.aspx
.NOTES
To determine if hyperthreading is enabled for the processor, compare LogicalProcessors and Cores.
If hyperthreading is enabled in the BIOS for the processor, then Cores is less than LogicalProcessors.
For example, a dual-processor system that contains two processors enabled for hyperthreading can run four threads or programs or simultaneously.
In this case, Cores is 2 and LogicalProcessors is 4.
Author: Øyvind Kallstad
Date: 01.12.2014
Version: 1.0
#>
[CmdletBinding()]
param (
# Specifies the target computer. Enter a fully qualified domain name, NetBIOS name, or an IP address. When the remote computer is in a different domain than the local computer,
# the fully qualified domain name is required.
[Parameter(Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[ValidateNotNullorEmpty()]
[string[]] $ComputerName = $env:COMPUTERNAME,
# Specifies a user account that has permission to perform this action.
[Parameter()]
[System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCredential]::Empty,
# Use this parameter to force the creation of a new CIM session. The default behaviour is to save the session and reuse it if possible.
[Parameter()]
[switch] $ForceNewCimSession
)
process {
foreach ($computer in $ComputerName) {
try {
# define hashtable for Test-WSMan properties
$wsmanProperties = @{
ComputerName = $computer
ErrorAction = 'SilentlyContinue'
}
if ($PSBoundParameters['Credential']){
$wsmanProperties.Authentication = 'Basic'
$wsmanProperties.Credential = $Credential
}
# check if wsman is responding
$wsmanTest = Test-WSMan @wsmanProperties
# based on whether the result of the wsman test, we decide on the protocol to use for the cim session
if (-not([string]::IsNullOrEmpty($wsmanTest))) {
$cimSessionOption = New-CimSessionOption Protocol Wsman
Write-Verbose 'Using protocol "Wsman"'
}
else {
$cimSessionOption = New-CimSessionOption Protocol Dcom
Write-Verbose 'Using protocol "Dcom"'
}
# define hashtable for cim session properties
$cimSessionProperties = @{
Name = $computer
ComputerName = $computer
SessionOption = $cimSessionOption
Verbose = $false
ErrorAction = 'Stop'
}
if ($PSBoundParameters['Credential']){ $cimSessionProperties.Credential = $Credential}
# first check to see if a cim session already exist, if so use this – if not, we create a new one
# if -ForceNewCimSession is used, always create a new cim session
if ((-not($cimSession = Get-CimSession Name $computer ErrorAction SilentlyContinue)) -or ($ForceNewCimSession)) {
Write-Verbose 'Creating new CIM session'
$cimSession = New-CimSession @cimSessionProperties SkipTestConnection
} else { Write-Verbose 'Using existing CIM session' }
# run query to get data
$processors = Get-CimInstance CimSession $cimSession Query 'SELECT * FROM Win32_Processor' Verbose:$false ErrorAction Stop
# iterate through the returned physical processors
foreach ($processor in $processors) {
# get processor architecture
switch ($processor.Architecture) {
0 {$processorArchitecture = 'x86'}
1 {$processorArchitecture = 'MIPS'}
2 {$processorArchitecture = 'Alpha'}
3 {$processorArchitecture = 'PowerPC'}
6 {$processorArchitecture = 'Itanium'}
9 {$processorArchitecture = 'x64'}
DEFAULT {$processorArchitecture = 'Unknown'}
}
# get processor status
switch ($processor.CpuStatus) {
0 {$cpuStatus = 'Unknown'}
1 {$cpuStatus = 'CPU Enabled'}
2 {$cpuStatus = 'Cpu Disabled by User via BIOS Setup'}
3 {$cpuStatus = 'CPU Disabled by BIOS (POST Error)'}
4 {$cpuStatus = 'CPU Is Idle'}
DEFAULT {$cpuStatus = 'Unknown'}
}
# get processor type
switch ($processor.ProcessorType) {
1 {$processorType = 'Other'}
2 {$processorType = 'Unknown'}
3 {$processorType = 'Central Processor'}
4 {$processorType = 'Math Processor'}
5 {$processorType = 'DSP Processor'}
6 {$processorType = 'Video Processor'}
DEFAULT {$processorType = 'Unknown'}
}
# CPU socket information, including the method by which this processor can be upgraded, if upgrades are supported
switch ($processor.UpgradeMethod) {
1 {$upgradeMethod = 'Other'}
2 {$upgradeMethod = 'Unknown'}
3 {$upgradeMethod = 'Daughter Board'}
4 {$upgradeMethod = 'ZIF Socket'}
5 {$upgradeMethod = 'Replacement or Piggy Back'}
6 {$upgradeMethod = 'None'}
7 {$upgradeMethod = 'LIF Socket'}
8 {$upgradeMethod = 'Slot 1'}
9 {$upgradeMethod = 'Slot 2'}
10 {$upgradeMethod = '370 Pin Socket'}
11 {$upgradeMethod = 'Slot A'}
12 {$upgradeMethod = 'Slot M'}
13 {$upgradeMethod = 'Socket 423'}
14 {$upgradeMethod = 'Socket A (Socket 462)'}
15 {$upgradeMethod = 'Socket 478'}
16 {$upgradeMethod = 'Socket 754'}
17 {$upgradeMethod = 'Socket 950'}
18 {$upgradeMethod = 'Socket 939'}
DEFAULT {$upgradeMethod = 'Unknown'}
}
# get processor availability
switch ($processor.Availability) {
1 {$processorAvailability = 'Other'}
2 {$processorAvailability = 'Unknown'}
3 {$processorAvailability = 'Running or Full Power'}
4 {$processorAvailability = 'Warning'}
5 {$processorAvailability = 'InTest'}
6 {$processorAvailability = 'Not Applicable'}
7 {$processorAvailability = 'Power Off'}
8 {$processorAvailability = 'Off Line'}
9 {$processorAvailability = 'Off Duty'}
10 {$processorAvailability = 'Degraded'}
11 {$processorAvailability = 'Not Installed'}
12 {$processorAvailability = 'Install Error'}
13 {$processorAvailability = 'Power Save – Unknown'}
14 {$processorAvailability = 'Power Save – Low Power Mode'}
15 {$processorAvailability = 'Power Save – Standby'}
16 {$processorAvailability = 'Power Cycle'}
17 {$processorAvailability = 'Power Save – Warning'}
DEFAULT {$processorAvailability = 'Unknown'}
}
$output = [PSCustomObject] [Ordered] @{
ComputerName = $computer
AddressWidth = $processor.AddressWidth
Architecture = $processorArchitecture
Availability = $processorAvailability
CpuStatus = $cpuStatus
CurrentClockSpeed = $processor.CurrentClockSpeed
CurrentVoltage = $processor.CurrentVoltage
DataWidth = $processor.DataWidth
Description = $processor.Description
DeviceID = $processor.DeviceID
Family = (Get-CpuFamily Key $processor.Family)
L2CacheSize = $processor.L2CacheSize
L3CacheSize = $processor.L3CacheSize
Manufacturer = $processor.Manufacturer
MaxClockSpeed = $processor.MaxClockSpeed
Name = $processor.Name
Cores = $processor.NumberOfCores
LogicalProcessors = $processor.NumberOfLogicalProcessors
ProcessorType = $processorType
Role = $processor.Role
SocketDesignation = $processor.socketDesignation
Status = $processor.Status
UpgradeMethod = $upgradeMethod
}
$defaultProperties = @('ComputerName','Name','Cores','LogicalProcessors','Status')
$defaultDisplayPropertySet = New-Object System.Management.Automation.PSPropertySet('DefaultDisplayPropertySet',[string[]]$defaultProperties)
$PSStandardMembers = [System.Management.Automation.PSMemberInfo[]]@($defaultDisplayPropertySet)
$output | Add-Member MemberType MemberSet Name PSStandardMembers Value $PSStandardMembers Force
Write-Output $output
Remove-Variable Name processorArchitecture,processorAvailability,cpuStatus,processorType,upgradeMethod ErrorAction SilentlyContinue
}
}
catch {
# if the connection fail we don't want to keep the session
Remove-CimSession Name $computer ErrorAction SilentlyContinue
Write-Warning "At line:$($_.InvocationInfo.ScriptLineNumber) char:$($_.InvocationInfo.OffsetInLine) Command:$($_.InvocationInfo.InvocationName), Exception: '$($_.Exception.Message.Trim())'"
}
}
}
}

view raw
Get-Cpu.ps1
hosted with ❤ by GitHub

function Get-CpuFamily {
<#
.SYNOPSIS
Convert CPU family code to string representation.
.NOTES
Author: Øyvind Kallstad
Date: 09.12.2014
Version: 1.0
#>
[CmdletBinding()]
param (
[Parameter(Position = 0, ValueFromPipeline)]
[ValidateRange(0,[int]::MaxValue)]
[int] $Key
)
# get processor family (https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=HTMLDocuments%2FWS-Management_Class_Reference%2FCIM_Processor.htm)
switch Exact ($Key) {
1 {$processorFamily = 'Other'}
2 {$processorFamily = 'Unknown'}
3 {$processorFamily = '8086'}
4 {$processorFamily = '80286'}
5 {$processorFamily = '80386'}
6 {$processorFamily = '80486'}
7 {$processorFamily = '8087'}
8 {$processorFamily = '80287'}
9 {$processorFamily = '80387'}
10 {$processorFamily = '80487'}
11 {$processorFamily = 'Pentium(R) brand'}
12 {$processorFamily = 'Pentium(R) Pro'}
13 {$processorFamily = 'Pentium(R) II'}
14 {$processorFamily = 'Pentium(R) processor with MMX(TM) technology'}
15 {$processorFamily = 'Celeron(TM)'}
16 {$processorFamily = 'Pentium(R) II Xeon(TM)'}
17 {$processorFamily = 'Pentium(R) III'}
18 {$processorFamily = 'M1 Family'}
19 {$processorFamily = 'M2 Family'}
20 {$processorFamily = 'Intel(R) Celeron(R) M processor'}
21 {$processorFamily = 'Intel(R) Pentium(R) 4 HT processor'}
{22..23 -contains $_} {$processorFamily = 'Reserved'}
24 {$processorFamily = 'K5 Family'}
25 {$processorFamily = 'K6 Family'}
26 {$processorFamily = 'K6-2'}
27 {$processorFamily = 'K6-3'}
28 {$processorFamily = 'AMD Athlon(TM) Processor Family'}
29 {$processorFamily = 'AMD(R) Duron(TM) Processor'}
30 {$processorFamily = 'AMD29000 Family'}
31 {$processorFamily = 'K6-2+'}
32 {$processorFamily = 'Power PC Family'}
33 {$processorFamily = 'Power PC 601'}
34 {$processorFamily = 'Power PC 603'}
35 {$processorFamily = 'Power PC 603+'}
36 {$processorFamily = 'Power PC 604'}
37 {$processorFamily = 'Power PC 620'}
38 {$processorFamily = 'Power PC X704'}
39 {$processorFamily = 'Power PC 750'}
40 {$processorFamily = 'Intel(R) Core(TM) Duo processor'}
41 {$processorFamily = 'Intel(R) Core(TM) Duo mobile processor'}
42 {$processorFamily = 'Intel(R) Core(TM) Solo mobile processor'}
43 {$processorFamily = 'Intel(R) Atom(TM) processor'}
{44..47 -contains $_} {$processorFamily = 'Reserved'}
48 {$processorFamily = 'Alpha Family'}
49 {$processorFamily = 'Alpha 21064'}
50 {$processorFamily = 'Alpha 21066'}
51 {$processorFamily = 'Alpha 21164'}
52 {$processorFamily = 'Alpha 21164PC'}
53 {$processorFamily = 'Alpha 21164a'}
54 {$processorFamily = 'Alpha 21264'}
55 {$processorFamily = 'Alpha 21364'}
56 {$processorFamily = 'AMD Turion(TM) II Ultra Dual-Core Mobile M Processor Family'}
57 {$processorFamily = 'AMD Turion(TM) II Dual-Core Mobile M Processor Family'}
58 {$processorFamily = 'AMD Athlon(TM) II Dual-Core Mobile M Processor Family'}
59 {$processorFamily = 'AMD Opteron(TM) 6100 Series Processor'}
60 {$processorFamily = 'AMD Opteron(TM) 4100 Series Processor'}
61 {$processorFamily = 'AMD Opteron(TM) 6200 Series Processor'}
62 {$processorFamily = 'AMD Opteron(TM) 4200 Series Processor'}
63 {$processorFamily = 'AMD FX(TM) Series Processor'}
64 {$processorFamily = 'MIPS Family'}
65 {$processorFamily = 'MIPS R4000'}
66 {$processorFamily = 'MIPS R4200'}
67 {$processorFamily = 'MIPS R4400'}
68 {$processorFamily = 'MIPS R4600'}
69 {$processorFamily = 'MIPS R10000'}
70 {$processorFamily = 'AMD C-Series Processor'}
71 {$processorFamily = 'AMD E-Series Processor'}
72 {$processorFamily = 'AMD A-Series Processor'}
73 {$processorFamily = 'AMD G-Series Processor'}
74 {$processorFamily = 'AMD Z-Series Processor'}
{75..79 -contains $_} {$processorFamily = 'Reserved'}
80 {$processorFamily = 'SPARC Family'}
81 {$processorFamily = 'SuperSPARC'}
82 {$processorFamily = 'microSPARC II'}
83 {$processorFamily = 'microSPARC IIep'}
84 {$processorFamily = 'UltraSPARC'}
85 {$processorFamily = 'UltraSPARC II'}
86 {$processorFamily = 'UltraSPARC IIi'}
87 {$processorFamily = 'UltraSPARC III'}
88 {$processorFamily = 'UltraSPARC IIIi'}
{89..95 -contains $_} {$processorFamily = 'Reserved'}
96 {$processorFamily = '68040'}
97 {$processorFamily = '68xxx Family'}
98 {$processorFamily = '68000'}
99 {$processorFamily = '68010'}
100 {$processorFamily = '68020'}
101 {$processorFamily = '68030'}
{102..111 -contains $_} {$processorFamily = 'Reserved'}
112 {$processorFamily = 'Hobbit Family'}
{113..119 -contains $_} {$processorFamily = 'Reserved'}
120 {$processorFamily = 'Crusoe(TM) TM5000 Family'}
121 {$processorFamily = 'Crusoe(TM) TM3000 Family'}
122 {$processorFamily = 'Efficeon(TM) TM8000 Family'}
{123..127 -contains $_} {$processorFamily = 'Reserved'}
128 {$processorFamily = 'Weitek'}
129 {$processorFamily = 'Reserved'}
130 {$processorFamily = 'Itanium(TM) Processor'}
131 {$processorFamily = 'AMD Athlon(TM) 64 Processor Family'}
132 {$processorFamily = 'AMD Opteron(TM) Processor Family'}
133 {$processorFamily = 'AMD Sempron(TM) Processor Family'}
134 {$processorFamily = 'AMD Turion(TM) 64 Mobile Technology'}
135 {$processorFamily = 'Dual-Core AMD Opteron(TM) Processor Family'}
136 {$processorFamily = 'AMD Athlon(TM) 64 X2 Dual-Core Processor Family'}
137 {$processorFamily = 'AMD Turion(TM) 64 X2 Mobile Technology'}
138 {$processorFamily = 'Quad-Core AMD Opteron(TM) Processor Family'}
139 {$processorFamily = 'Third-Generation AMD Opteron(TM) Processor Family'}
140 {$processorFamily = 'AMD Phenom(TM) FX Quad-Core Processor Family'}
141 {$processorFamily = 'AMD Phenom(TM) X4 Quad-Core Processor Family'}
142 {$processorFamily = 'AMD Phenom(TM) X2 Dual-Core Processor Family'}
143 {$processorFamily = 'AMD Athlon(TM) X2 Dual-Core Processor Family'}
144 {$processorFamily = 'PA-RISC Family'}
145 {$processorFamily = 'PA-RISC 8500'}
146 {$processorFamily = 'PA-RISC 8000'}
147 {$processorFamily = 'PA-RISC 7300LC'}
148 {$processorFamily = 'PA-RISC 7200'}
149 {$processorFamily = 'PA-RISC 7100LC'}
150 {$processorFamily = 'PA-RISC 7100'}
{151..159 -contains $_} {$processorFamily = 'Reserved'}
160 {$processorFamily = 'V30 Family'}
161 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 3200 Series'}
162 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 3000 Series'}
163 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 5300 Series'}
164 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 5100 Series'}
165 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 5000 Series'}
166 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor LV'}
167 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor ULV'}
168 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 7100 Series'}
169 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 5400 Series'}
170 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor'}
171 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 5200 Series'}
172 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 7200 Series'}
173 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 7300 Series'}
174 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 7400 Series'}
175 {$processorFamily = 'Multi-Core Intel(R) Xeon(R) processor 7400 Series'}
176 {$processorFamily = 'Pentium(R) III Xeon(TM)'}
177 {$processorFamily = 'Pentium(R) III Processor with Intel(R) SpeedStep(TM) Technology'}
178 {$processorFamily = 'Pentium(R) 4'}
179 {$processorFamily = 'Intel(R) Xeon(TM)'}
180 {$processorFamily = 'AS400 Family'}
181 {$processorFamily = 'Intel(R) Xeon(TM) processor MP'}
182 {$processorFamily = 'AMD Athlon(TM) XP Family'}
183 {$processorFamily = 'AMD Athlon(TM) MP Family'}
184 {$processorFamily = 'Intel(R) Itanium(R) 2'}
185 {$processorFamily = 'Intel(R) Pentium(R) M processor'}
186 {$processorFamily = 'Intel(R) Celeron(R) D processor'}
187 {$processorFamily = 'Intel(R) Pentium(R) D processor'}
188 {$processorFamily = 'Intel(R) Pentium(R) Processor Extreme Edition'}
189 {$processorFamily = 'Intel(R) Core(TM) Solo Processor'}
190 {$processorFamily = 'K7'}
191 {$processorFamily = 'Intel(R) Core(TM)2 Duo Processor'}
192 {$processorFamily = 'Intel(R) Core(TM)2 Solo processor'}
193 {$processorFamily = 'Intel(R) Core(TM)2 Extreme processor'}
194 {$processorFamily = 'Intel(R) Core(TM)2 Quad processor'}
195 {$processorFamily = 'Intel(R) Core(TM)2 Extreme mobile processor'}
196 {$processorFamily = 'Intel(R) Core(TM)2 Duo mobile processor'}
197 {$processorFamily = 'Intel(R) Core(TM)2 Solo mobile processor'}
198 {$processorFamily = 'Intel(R) Core(TM) i7 processor'}
199 {$processorFamily = 'Dual-Core Intel(R) Celeron(R) Processor'}
200 {$processorFamily = 'S/390 and zSeries Family'}
201 {$processorFamily = 'ESA/390 G4'}
202 {$processorFamily = 'ESA/390 G5'}
203 {$processorFamily = 'ESA/390 G6'}
204 {$processorFamily = 'z/Architectur base'}
205 {$processorFamily = 'Intel(R) Core(TM) i5 processor'}
206 {$processorFamily = 'Intel(R) Core(TM) i3 processor'}
{207..209 -contains $_} {$processorFamily = 'Reserved'}
210 {$processorFamily = 'VIA C7(TM)-M Processor Family'}
211 {$processorFamily = 'VIA C7(TM)-D Processor Family'}
212 {$processorFamily = 'VIA C7(TM) Processor Family'}
213 {$processorFamily = 'VIA Eden(TM) Processor Family'}
214 {$processorFamily = 'Multi-Core Intel(R) Xeon(R) processor'}
215 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 3xxx Series'}
216 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 3xxx Series'}
217 {$processorFamily = 'VIA Nano(TM) Processor Family'}
218 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 5xxx Series'}
219 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 5xxx Series'}
220 {$processorFamily = 'Reserved'}
221 {$processorFamily = 'Dual-Core Intel(R) Xeon(R) processor 7xxx Series'}
222 {$processorFamily = 'Quad-Core Intel(R) Xeon(R) processor 7xxx Series'}
223 {$processorFamily = 'Multi-Core Intel(R) Xeon(R) processor 7xxx Series'}
224 {$processorFamily = 'Multi-Core Intel(R) Xeon(R) processor 3400 Series'}
{225..227 -contains $_} {$processorFamily = 'Reserved'}
228 {$processorFamily = 'AMD Opteron(TM) 3000 Series Processor'}
229 {$processorFamily = 'AMD Sempron(TM) II Processor Family'}
230 {$processorFamily = 'Embedded AMD Opteron(TM) Quad-Core Processor Family'}
231 {$processorFamily = 'AMD Phenom(TM) Triple-Core Processor Family'}
232 {$processorFamily = 'AMD Turion(TM) Ultra Dual-Core Mobile Processor Family'}
233 {$processorFamily = 'AMD Turion(TM) Dual-Core Mobile Processor Family'}
234 {$processorFamily = 'AMD Athlon(TM) Dual-Core Processor Family'}
235 {$processorFamily = 'AMD Sempron(TM) SI Processor Family'}
236 {$processorFamily = 'AMD Phenom(TM) II Processor Family'}
237 {$processorFamily = 'AMD Athlon(TM) II Processor Family'}
238 {$processorFamily = 'Six-Core AMD Opteron(TM) Processor Family'}
239 {$processorFamily = 'AMD Sempron(TM) M Processor Family'}
{240..249 -contains $_} {$processorFamily = 'Reserved'}
250 {$processorFamily = 'i860'}
251 {$processorFamily = 'i960'}
{252..253 -contains $_} {$processorFamily = 'Reserved'}
254 {$processorFamily = 'Reserved (SMBIOS Extension)'}
255 {$processorFamily = 'Reserved (Un-initialized Flash Content – Lo)'}
{256..259 -contains $_} {$processorFamily = 'Reserved'}
260 {$processorFamily = 'SH-3'}
261 {$processorFamily = 'SH-4'}
{262..279 -contains $_} {$processorFamily = 'Reserved'}
280 {$processorFamily = 'ARM'}
281 {$processorFamily = 'StrongARM'}
{282..299 -contains $_} {$processorFamily = 'Reserved'}
300 {$processorFamily = '6×86'}
301 {$processorFamily = 'MediaGX'}
302 {$processorFamily = 'MII'}
{303..319 -contains $_} {$processorFamily = 'Reserved'}
320 {$processorFamily = 'WinChip'}
{321..349 -contains $_} {$processorFamily = 'Reserved'}
350 {$processorFamily = 'DSP'}
{351..499 -contains $_} {$processorFamily = 'Reserved'}
500 {$processorFamily = 'Video Processor'}
{501..65533 -contains $_} {$processorFamily = 'Reserved'}
65534 {$processorFamily = 'Reserved (For Future Special Purpose Assignmet'}
65535 {$processorFamily = 'Reserved'}
DEFAULT {$processorFamily = 'Unknown'}
}
Write-Output $processorFamily
}

view raw
Get-CpuFamily.ps1
hosted with ❤ by GitHub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s