title: PowerShell InputObject
body: <p>All three of these methods display the results in similar manners. My question is why in METHOD 01, I can't use Write-Output {$_.FullName}, instead, I have to use a ForEach-Object?</p>
  <p>I have to use METHOD 01 to run it against a function that I created.</p>
  <pre><code>Clear-Host
  
  #METHOD 01
  Get-ChildItem -Path 'D:\' -Directory -Depth 0 | 
  ForEach-Object{$_.FullName} | 
  Sort-Object
  
  #METHOD 02 (Sticking into Variable)
  $AA = Get-ChildItem -Path 'D:\' -Directory -Depth 0
  Write-Output $AA.FullName | 
  Sort-Object
  
  #METHOD 03 (Sticking into Variable)
  $AA = Get-ChildItem -Path 'D:\' -Directory -Depth 0
  ForEach($oItem in $AA)
  {
      $oItem.FullName
  }
  </code></pre>