My PowerScript script contains a piece of code like:
$logfile = "C:\myfiles\mylog.txt"
$name = "My name is Mario"
$name | Out-File -FilePath $logfile -Encoding ASCII -append
$now = Get-Date -Format "yyyy.MM.dd HH:mm:ss"
$now | Out-File -FilePath $logfile -Encoding ASCII -append
When I open mylog.txt I see Chineese (or Japaneese) characters instead of the ASCII characters I expect.
What am I missing?
I'm using PowerShell 2.0 on a Windows Server 2008 R2 server with Italian local language.
Regards
Mario