DEV Community

Discussion on: How do I Include Click Event in Powershell Notification?

4lch4 profile image
Devin W. Leaman

This mostly comes down to how you're executing the PowerShell script itself. If you're running it within the ISE, it'll show the notification but the script shuts down and isn't available to catch the click event. I wrote a small script that might help point you in the right direction.

In short, I create a function that shows the notification, dot-source the script that has the function, then call the function from the console or another file as needed and it does what's expected.