What is
ÿþC
?
ÿþ
é uma representação da BOM (marca de pedido de byte) por codificação UTF-16 (LE) .
And why it said that?
Porque o Out-File
usa a codificação da página de código ANSI atual do sistema por padrão:
-Encoding
Specifies the type of character encoding used in the file. Valid values are "Unicode", "UTF7", "UTF8", "UTF32", "ASCII", "BigEndianUnicode", "Default", and "OEM". "Unicode" is the default. "Default" uses the encoding of the system's current ANSI code page.
A solução é usar -Encoding ASCII
para se livrar de caracteres ilegíveis:
"C:\Program Files\ClamAV-x64" -Recurse | Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-1) } | % { $_.FullName } | Out-File "C:\Program Files\ClamAV-x64\file_to_scan.txt" -Encoding ASCII'
Files\ClamAV-x64'; & 'C:\Program Files\ClamAV-x64\clamdscan.exe' -f .\file_to_scan.txt"
win8:
C:\Program Files\ClamAV-x64\eicar.com.txt: Eicar-Test-Signature FOUND
C:\Program Files\ClamAV-x64\file_to_scan.txt: OK
C:\Program Files\ClamAV-x64\report.txt: OK
C:\Program Files\ClamAV-x64\scan.ps1: OK
C:\Program Files\ClamAV-x64\sendmail.ps1: OK
----------- SCAN SUMMARY -----------
Infected files: 1
Time: 5.845 sec (0 m 5 s)
ERROR: Minions returned with non-zero exit code
Fonte: link