You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i use Write-WinEvent i get "System.Collections.Generic.List`1[System.String]" in Event Message 8and not my message.
To Reproduce
Steps to reproduce the behavior:
$EventData = [ordered]@{Program = 'MyProgram';ThisEvent = 'This is an event I want to track'; SomethingElse = 'I like the C64'}
Write-WinEvent -LogName "Application" -Provider Userinfo -EventId 999 -EventType Information -EventData $EventData
Expected behavior
{
"Program": "MyProgram",
"ThisEvent": "This is an event I want to track",
"SomethingElse": "I like the C64"
}
Screenshots
If applicable, add screenshots to help explain your problem.
PowerShell Environment (please complete the following information):
When i use Write-WinEvent i get "System.Collections.Generic.List`1[System.String]" in Event Message 8and not my message.
To Reproduce
Steps to reproduce the behavior:
$EventData = [ordered]@{Program = 'MyProgram';ThisEvent = 'This is an event I want to track'; SomethingElse = 'I like the C64'}
Write-WinEvent -LogName "Application" -Provider Userinfo -EventId 999 -EventType Information -EventData $EventData
Expected behavior
{
"Program": "MyProgram",
"ThisEvent": "This is an event I want to track",
"SomethingElse": "I like the C64"
}
Screenshots
If applicable, add screenshots to help explain your problem.
PowerShell Environment (please complete the following information):
Additional context
function Write-WinEvent from
https://gist.githubusercontent.com/thedavecarroll/765547120aa1fa801919040f4d5d2046/raw/2def9b386a8eae88bc26726b7d8770c4c1f8452f/EventData.psm1
works
The text was updated successfully, but these errors were encountered: