首页 > 解决方案 > How to create event and listen for event in powershell

问题描述

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

标签: windowspowershell

解决方案


推荐阅读