Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write-WinEvent gets "System.Collections.Generic.List`1[System.String]" in Event Message #48

Open
endoleg opened this issue Mar 17, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@endoleg
Copy link

endoleg commented Mar 17, 2021

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.
image

PowerShell Environment (please complete the following information):

  • OS: [Windows 10]
  • Version [1909]

Additional context
function Write-WinEvent from
https://gist.githubusercontent.com/thedavecarroll/765547120aa1fa801919040f4d5d2046/raw/2def9b386a8eae88bc26726b7d8770c4c1f8452f/EventData.psm1
works

@endoleg endoleg added the bug Something isn't working label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants