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.

22
do you sometimes _dream_ about code?
Post Body

howdy y'all,

this fabulous answer by SeeminglyScience ...

SeeminglyScience comments on is there a builtin enum for "PCSystemType"?
— https://www.reddit.com/r/PowerShell/comments/8jdczz/is_there_a_builtin_enum_for_pcsystemtype/dyzw5fq/

... got me to fiddling with the code. it gave me fits until i realized 3 things ...

  • the CIM_* classes don't necessarily contain the same qualifiers as the Win32_* classes
    specifically, CIM_ComputerSystem does not contain PCSystemType in the qualifier list. it shows in the property list from a Get-CimInstance call, but the qualifier list aint there. [frown]
  • the ValueMap key list does NOT exist for all the Value items
    for instance, the DomainRole qualifier has only the Value list.
  • those items that DO have a ValueMap seem to only have a direct-to-index mapping
    [edit - MOST ValueMap items are direct indexes into Values. Win32_OperatingSystem ProductType is NOT one such. ValueMap = 1,2,3 & Values IndexRange = 0,1,2]
    for example, the ValueMap=0 indexes to Value[0] in all the cases i could find.

that has taken me two days to work thru. [grin] it's resulted in dreams about that chunk of code that have been danged vivid.

i rarely remember having dreams. when i do, they are usually about a book i am reading, a game i am playing, OR code that is giving me fits.

so, do any of y'all have dreams about your current code problems?

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: 3 days 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