title: PowerShell Out-file manipulation
body: <p>i hope someone can help.
  I am trying to manipulate a file created by powershell.
  I managed to get to the end result that i want, but i am sure it would be easier if it was only one command.</p>
  
  <pre><code># Invoke the Exchange Snapping ( make sure you are Exchange Admin to do it SO)
  add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
  
  #Create a file with list of DL in the organization
  Get-DistributionGroup | Select-Object Name | Out-File C:\Pre_DLGroups.txt
  $content = Get-Content C:\Pre_DLGroups.txt
  
  #Remove the 3 first lines of the file that you dont need it
  $content | Select-Object -Skip 3 | Out-file C:\DLGroups.txt
  
  #Trim the space in the end and crate the Final file
  Get-Content C:\DLGroups.txt | Foreach {$_.TrimEnd()} | Set-Content c:\FinalDLGroup.txt
  </code></pre>
  
  <p>is that way to make the end result in a single file rather than creating 3?
  cheers</p>
  
  <p>Elton</p>