Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

7
is there a builtin enum for "PCSystemType"?
Post Body

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

Author
Account Strength
100%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
27,226
Link Karma
672
Comment Karma
25,727
Profile updated: 6 hours ago
Posts updated: 8 months ago
[grin]

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago