This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
howdy y'all,
when you get the PCSystemType from Win32_ComputerSystem it comes back as a number. i've found online lists of what those numbers map to. what i haven't found is how that info is handled in dotnet.
having to look it up, save it to your util, and then reference it ... is so very problematic. [frown]
so, just as there is a way to get the list of day names, console colors, and other such ... is there a way to get the human-friendly version of that index number?
for those who aint run into it yet, lookee [grin] ...
$CompSys = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $env:COMPUTERNAME
switch ($CompSys.PCSystemType)
{
0 {$PCSTName = 'Unspecified'
break}
1 {$PCSTName = 'Desktop'
break}
2 {$PCSTName = 'Laptop_Or_Mobile'
break}
3 {$PCSTName = 'Workstation'
break}
4 {$PCSTName = 'Enterprise_Server'
break}
5 {$PCSTName = 'SOHO_Server'
break}
6 {$PCSTName = 'Appliance_PC'
break}
7 {$PCSTName = 'Performance_Server'
break}
8 {$PCSTName = 'Maximum'
break}
default {'Unknown_ID'}
}
$PCSTName
take care,
lee
Subreddit
Post Details
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...