Ich have got an array with names called $arraylist_user
. I run with a for-loop through out the array.
On every loop I output the text
echo "User:" $arraylist_user[$i] "isn´t in the office!" | Out-File -FilePath "C:\Temp\test.txt" -Append -encoding unicode
through a txt-File.
I got every part in a newline. Like:
User:
Tom
isn´t in the office!
How can I get the complete sentence User: Tom isn´t in the office!
in one line in the text file.
I tried:
echo -NoNewLine "User:" $arraylist_user[$i] "isn´t in the office!" | Out-File -FilePath "C:\Temp\test.txt" -Append -encoding unicode
Without success.