title: Powershell Add-Content Truncating Output
body: <p>I'm using the Add-Content cmdlet in a PowerShell script to write the matches in a foreach loop to a separate text file. To do this, I'm using the following code:</p>
  
  <pre><code>Add-Content -Path $varListNotFound $match
  </code></pre>
  
  <p>The <code>$varListNotFound</code> contains the file name and path while the <code>$match</code> is the variable in the foreach loop that is being matched in my range of items.</p>
  
  <p>I'm not sure if it makes a difference, but the matches I'm matching are being pulled from an XML document.</p>
  
  <p>In the output text file, the matches found in the <code>&lt;name&gt;&lt;/name&gt;</code> node of my XML file are output correctly unless the name is long. When the name is too long, it is truncating the name to 76 characters and adding three periods after it. This is causing problem with this line of code that I'm using the clear out the unused items:</p>
  
  <p><code>$xml.rhpml.variables.variable | ? { $varRemove -contains $_.name } | % {$xml.rhpml.variables.RemoveChild($_)}</code></p>
  
  <p>I've added to my script so that I can remove the ellipses from the end of the truncation, but the truncated name is not being removed from the XML document.</p>
  
  <p>Is there a way to extend the length of the Add-Content? Or is there a way to get the above XML code to not exclude the truncated names?</p>
  
  <p>I tried changing <code>$varRemove -contains $_.name</code> to <code>$varRemove -like$_.name</code>, but it didn't remove the nodes from the XML.</p>