title: PowerShell Cmdlets .length attribute for one element result
body: <p>I am using a Cmdlet which can return one or more elements:</p>
  
  <pre><code>PS C:\Users\admin&gt; $x = Get-myObjects
  PS C:\Users\admin&gt; $x
  
  
  ComputerName               : test-2
  Description                : n/a
  Id                         : cbcb1ece-99f5-4478-9f02-65a622df8a98
  IsActive                   :
  MinNum                     : 0
  Name                       : scom-test2-mp
  modeType                   : 1
  PSComputerName             :
  </code></pre>
  
  <p>If I use length attribute I get nothing.</p>
  
  <pre><code>PS C:\Users\admin&gt; $x.length
  PS C:\Users\admin&gt;
  </code></pre>
  
  <p>Yet, if the <code>Get-myObjects</code> cmdlet returns 2 or more, then it is a collection and I can get <code>.length</code> attribute.</p>
  
  <p>How can I get the .length to work if the Get-myObjects cmdlet returns a single object for one object value?</p>