I would recommend that your Powershell returns data in JSON format instead of Format-Table.
Get-EventLog -LogName $Logname -EntryType $EntryType | select TimeGenerated, Source, Message -First $Top | ConvertTo-JSON

Format-Table removes object data and is not easily manipulable (by a computer) as it becomes essentially text. So yes you are exposing yourself to what you’re going through.
Cheers!