title: Powershell Write-Host append to text file - computer name and time stamp
body: <p>I am a Powershell noobie and I am currently writing my second script so bear with me. I am trying to do a <code>write-host</code> and output my write-host message along with a time stamp and what computer is completing my various script blocks to a text file and I am having issues with which syntax to make things work. </p>
  
  <p>I tried the following for testing purposes. This will be going to a server once I get the Syntax down - for now it goes to my local <code>C:</code> drive. </p>
  
  <pre><code>write-host "folders created successfully $env:computername" &gt;&gt; c:\scripts\testlog.txt
  </code></pre>
  
  <p>The behavior I'm seeing is the text file is being created but there's no contents in it - all blank.</p>