PowerShell automatically displays all object properties when you output the object to the console. Here is an example:
Actually, PowerShell uses its internal type system to select which object properties to show. This is smart because most objects have plenty of properties, and if you tried to show them all, your console would have a hard time displaying this wealth of information in a readable manner.
To really view all object properties, you should pass the object to Format-List and add an asterisk:
This will not always work in rare circumstances. Here is an example where the $error automatic variable stores all errors that occurred in your session. This is actually an array, and the first element returns the last (most current) error record:
If you don't get back anything, no error has occurred yet. In this case, you should simply cause an error like so:
Now, the strange thing happens when you try and output the error record Exception property:
For some reason, you only get back the error text message. Things do not change when you pass on the result to Format-List:
In these situations, you can use the -Force switch to bypass the type system. Now, this all works as expected: