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