title: PowerShell - Remove spaces between words from txt file
body: <p>I am a noob at powershell and still trying to learn scripting but stumbling on the basics.
  I have a text file that contains a list of websites</p>
  
  <pre><code>Default Websites
  Power Shell
  Hello World
  </code></pre>
  
  <p>I need to remove the white spaces between the words so I get the outcome below</p>
  
  <pre><code>DefaultWebsites
  PowerShell
  HelloWorld
  </code></pre>
  
  <p>I have tried using the Trim('') command but it is not removing the white spaces.</p>
  
  <p>Here is my original script that removes all white spaces at the beginning and the end and any blank lines. what do I need to add to the script to remove the white spaces in between words?</p>
  
  <pre><code>Get-WmiObject -Class IIsWebServerSetting -Namespace "root\microsoftiisv2" | Select ServerComment | Format-Table -HideTableHeaders | out-file c:\website.txt
  $b = Get-Content -Path C:\website.txt
  $b | ForEach {$_.TrimEnd()} | ? {$_.trim() -ne '' } &gt; C:\website.txt
  </code></pre>
  
  <p>Thank you in advance. I appreciate any help.</p>