We are using Splunk on Windows and in the latest version we now need to migrate our scripted alerts to custom alerts. Long story short, the new framework does not longer use positional arguments but payload (stdin). If using Python it is simple, as shown in Spunk documentation
settings = json.loads(sys.stdin.read())
I have not been able to figure out how I can do the same using Powershell. The cmdlet read-host only reads stdin from the keyboard. I have also found examples of using the cmdlet get-content to read from stdin, but I have only found examples when using an exsisting file
Get-Content c:\scripts\test.txt
It might be that I need to do something related to what is described in this accepted answer.
$psi = New-Object System.Diagnostics.ProcessStartInfo;
....
....
But I do not want to send to stdin of another process, I want to read what another process has sent to "my" process, the Powershell-script.