In PowerShell, if a command returns an array of one or more objects, I can find out the class of the object by the following method:
$ab = SampleCommand
$ab[0].getType()
But, how can I find out the default return type of a command if the command returned nothing (array of 0 values)?
Note: For example, I am working on SCOM PowerShell commands, and I am trying to find the default return class type of command get-scomscadvisoragent
, but it returns nothing as the advisor agent is not configured in my lab setup. Hence, I am not able to get the class of returned object.