System.Management.Automation.CommandInfo object provides information about a PowerShell command. In PowerShell, an instance or an array of instances of CommandInfo can be obtained with the get-command cmdLet. CommandInfo object, it can be passed to the constructor of System.Management.Automation.CommandMetadata which creates another object that then can be used to query meta information about a command. $myInvocation.myCommand stores a CommandInfo object.