Running a script as a different user

Hello,
I read all about hash tables and pscustom objects, but Im still confused on that part of the script.

I understand that this line

[PSCustomObject]$ResultHashtable

makes the hashtable a custom object. Thats awesome, now can pipe it to .csv files and it still looks nice.

I commented out that line, expecting to still see the hashtable as output, but I see nothing as output. How come I dont see anything output whenn that line is commented out?

Thanks!

You might have a misconception about this command in your mind.

Yes - it creates a [PSCustomObject] A N D outputs it ! ! !

When you remove the only output producing line of code from your code you don’t have any output anymore. :man_shrugging:t4: