Question

Is there any way to view the In words section of an event thru Powershell or thru the command prompt.

enter image description here

I have tried

  1. psloglist -m 120 -s -x

  2. Get-EventLog application | ft TimeGenerated,@{label="Data";expression={[char[]][int[]]$_.data -join ""}}

But none give the desired output.

Was it helpful?

Solution

I got a quick and dirty one, which works on my laptop:

Get-EventLog application | % {
    $bytes =  $_.Data
    while ($bytes.Length % 4 -ne 0) {$bytes = $bytes + @(0)}
    for ($i = 0; $i -lt $bytes.Length; $i += 4) 
    {
        $curWord = [System.BitConverter]::ToUInt32($bytes, $i).ToString("X8")
        Write-Output $curWord
    }
    Write-Output ""
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top