System Tray Application

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Posts: 18
Last visit: Wed May 05, 2021 3:10 pm

System Tray Application

Post by jdainsworth »

I am working on a System Tray Application that i am developing in PowerShell Studio. I would like to execute some cleanup code if someone clicks on the exit menu item. I was hoping i might be able to do it with a powershell.exiting event, but that event doesn't appear to fire.

Any advice on that?

Posts: 14872
Last visit: Mon Jul 26, 2021 3:28 am
Answers: 12
Has voted: 3 times
Been upvoted: 10 times

Re: System Tray Application

Post by jvierra »

Use a project and package it then use the Application_Exit event to do the cleanup or just place the code after the call to the main form.

Posts: 1
Last visit: Wed May 12, 2021 5:32 am

Re: System Tray Application

Post by MadeleineBailey »

Txh for answer, It helped!