I'm writing a small file out to a log, and it will hold the names of multiple VMs. I want to make sure that I put the date with the VM names, and then I want a new line for each VM. I tried something like this:
("$(Get-date -format MM-dd-yy) `r `n" + "$Removed") | Out-File c:\Scripts\test.txt -Append
The date shows, and at first I was only using `n for the new line, and then I tried `r and `n, but everything gets put on one line, and then spaced apart, like this:
09-12-13 VMname VMname
I'm sure I'm missing something simple, but why isn't the new line appearing?