Skip to content

Instantly share code, notes, and snippets.

$JSON = @'
{
"template": "powerstash-*",
"mappings": {
"eventlogentry": {
"properties" : {
"Id": { "type": "string" },
"TimeCreated" : { "type" : "date" },
"DateCreated" : { "type" : "date" },
"EventId" : { "type" : "integer" },
# Pass your collection script and parameters, it will do the rest
Invoke-PowerStash -Scriptblock ${function:Get-CimEvents} `
-Parameters @{CimSession=$Sessions;LogName='Security';EventId=4624}