i use this powershell command:
get-vm | ft name, *start*, *stop*, customproperties
that returns objects with a string array as a property (customproperties):
Name StartAction DelayStart StopAction CustomProperties
---- ----------- ---------- ---------- ----------------
TKAD4 AlwaysAutoTurnOnVM 0 ShutdownGuestOS {NoStartupDelay, ...
TKAD3 AlwaysAutoTurnOnVM 0 ShutdownGuestOS {NoStartupDelay, ...
how can i return just one element from an array the is a property as an object to display it as part of a table?
my desired output would look like this:
Name StartAction DelayStart StopAction Custom1
---- ----------- ---------- ---------- -------
TKAD4 AlwaysAutoTurnOnVM 0 ShutdownGuestOS NoStartupDelay
TKAD3 AlwaysAutoTurnOnVM 0 ShutdownGuestOS NoStartupDelay
In your Format-Table, change
custompropertiesto either:If it is an array. If it is a collection use: