title: Get $webclient.downloadstring to write to text file in Powershell
body: <p>I'm not a programmer/scripter. I just need to get the following script to write to a file:</p>
  
  <pre><code>[CmdletBinding()]
  param ()
  
  # Create a web client object
  $webClient = New-Object System.Net.WebClient
  
  
  # Returns the public IP address
  $webClient.DownloadString('http://myip.dnsomatic.com/')
  </code></pre>
  
  <p>I've tried out-file and export-csv but it write a blank file. I'm sure it's something simple...but having no knowledge makes it difficult for me. </p>