Control encoding of batch-created file
You are wrong in assuming your editor Notepad++
reads the file created in PowerShell as UTF8.
It is UTF16-LE
/UCS-2 LE-BOM
with a BOM 0xFF 0xFE
The tree file created in cmd.exe is encoded in the actice codepage, see output of chcp
and change the encoding in Notepad++
accordingly.
> chcp
Aktive Codepage: 850.
Change Encoding (in my German locale Notepad++):