I sometimes wished that the default output for an object would incorporate an additional property that I find useful.
For example :
$x = ps - ComputerName server1 | select -First 1
$x | fl
Id : 880
Handles : 397
CPU :
Name : acnamagent
What if I want to display all those properties + the MachineName property ?
$x | select Id,Handles,CPU,Name,MachineName
Id : 880
Handles : 397
CPU :
Name : acnamagent
MachineName : server1
This works but I don't want to explicitely name all those default properties.
I tried to play with PSStandardMembers.DefaultDisplayPropertySet.ReferencedPropertyNames but I couldn't get it to work.
Can this be done easily ?