79779081

Date: 2025-09-30 12:22:19
Score: 1
Natty:
Report link

Thank you.

What I don't understand is that the debugger shows BaseObject to be of type PSVersionHashTable ; so, why can't I do:

ConsoleWriteLine((result[0].BaseObject)["OS"]);

What works is (as you've explained):

ConsoleWriteLine(((PSVersionHashTable)result[0].BaseObject)["OS"]);

The cast to PSVersionHashTable puzzles me...

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Andreas