title: Powershell - Write-output to text syntax for variables and strings
body: <p>I have the following:</p>
  
  <p>$i = a number that changes</p>
  
  <p>new-variable -name cowNumber$($i+1) -value [some value]</p>
  
  <p>I want to output this to a text file so that it reads:</p>
  
  <p>Write-Output "The number of cows in field2: [cowNumber value]" | Out-file [some path] -append</p>
  
  <p>where field2 is formatted as field($i+1) and [cowNumber value] is cowNumber$($i+1)</p>
  
  <p>Any information is appreciated, thanks.</p>