1

Could you let me know in windows machine how one program/PowerShell creates events/message. another program/PowerShell that continuously runs listens for events/message generated by other programs.

Tried following: Created event using following command in powershell 1(session1)

New-Event -SourceIdentifier "data" -MessageData "Test"

Received event using following command in powershell 1(session1)

get-event

Removed event using following command in powershell 1(session1)

remove-event

Tried to use get and remove events from powershell 2(sesion2 in same machine), but not able to retrieve event. How to receive and remove commands from powershell 2(session2 in same machine)?

Note: Powershell version 7

satish
  • 341
  • 2
  • 5
  • 9
  • Events, event subscriptions, and the event queue exist only in the current session. See [MS Docs - New-Event](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-event?view=powershell-7.1) – Dennis Sep 01 '21 at 14:26
  • Pipelining (not pipelines) however can be used as interprocess communication (IPC), see [StackOverflow - Pipelining between two SEPARATE Powershell processes](https://stackoverflow.com/questions/32056955/pipelining-between-two-separate-powershell-processes) and this old article [Interprocess Communication in Powershell](https://gbegerow.wordpress.com/2012/04/09/interprocess-communication-in-powershell/) – Dennis Sep 01 '21 at 14:33

0 Answers0