title: add-content : The input object cannot be bound to any parameters for the command either because
body: <p>I am trying to generate a text file with output I need to build in a for each statement but I get this error:</p>
  
  <blockquote>
    <p>add-content : The input object cannot be bound to any parameters for
    the command either because the command does not take pipeline input or
    the input and its properties do not match any of the parameters that
    take pipeline input.</p>
  </blockquote>
  
  <p>What am I missing here?</p>
  
  <pre><code>foreach($item in $filteredItems)
  {
      $user = $web.EnsureUser($item)
      if (-Not $profileManager.UserExists($user.LoginName))
      {
          $loginName = $user.LoginName.Substring(13)
          #Write-Host $loginName
          $userFromAD = Get-ADUser -Filter {SAMAccountName -eq $loginName}
          $concatenatedUser = $user.ID.ToString() + ";#" + $userFromAd.Name
          #Write-Host  $concatenatedUser
          $query = [String]::Format("&lt;Where&gt;&lt;Contains&gt;&lt;FieldRef Name='Persons_PDB' LookupId='True'/&gt;&lt;Value Type='LookupMulti'&gt;{0}&lt;/Value&gt;&lt;/Contains&gt;&lt;/Where&gt;",$user.ID)
          $userItemsQuery = New-Object Microsoft.SharePoint.SPQuery
          $userItemsQuery.Query = $query
          $userItemsQuery.ViewAttributes = 'Scope="Recursive"'
          $userItems = $list.GetItems($userItemsQuery)
          #Write-Host "Numer of items found: " $userItems.Count
          foreach($item in $userItems)
          {
              #Write-Host $userFromAd.Name
              if([string]::IsNullOrEmpty($userFromAd.Name)){
                  $output = "Person not in AD, file will be deleted:"+ $item.File.Name 
                  write-output $output | add-content D:\Installers\PictureDB\R 1.0\Scripts\Add-ArtifactsToWeb\usernotinAD.txt
              }
  </code></pre>