Example of Project I'm Attempting?

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
bzowky
Posts: 7
Last visit: Mon Sep 16, 2019 3:13 pm

Example of Project I'm Attempting?

Post by bzowky »

Good Afternoon -

I've always been interested in Powershell Studio and recently reinstalled the trial. I'm trying to create an application/script that does a couple of basic actions, but having issues getting it to work. If possible, could you point me to an example / sample project that is similar so that I may see if the result is what I want? If none exist, any assistance or links would be appreciated.

Project Goal
Upon running, it will execute an existing PS1 script with the -noexit parameter then minimize to a custom icon in the system tray. Right clicking on the tray icon will provide an "Exit" option which when selected will stop the script which was initially started with the -noexit parameter and close out of the app therefore removing the tray icon.

Anything you could do to assist would be appreciated -

Thank You
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Example of Project I'm Attempting?

Post by davidc »

We have a packager engine / host that is a system tray application:

https://www.sapien.com/blog/2017/07/10/ ... owershell/

Please let us know if this is indeed what you are looking for.

Alternatively, you could use PowerShell Studio's designer to add a NotifyIcon control that displays in the system tray:

https://info.sapien.com/index.php/guis/ ... on-control
David
SAPIEN Technologies, Inc.
User avatar
bzowky
Posts: 7
Last visit: Mon Sep 16, 2019 3:13 pm

Re: Example of Project I'm Attempting?

Post by bzowky »

Thank you -

I actually found out about that after posting, but having an issue. I built the script and executed the EXE, but it immediately closes. I'm sure it's because most of the scripts I wish to compile use "IO.FileSystemWatcher" therefore when launching from command line using powershell.exe, I must include the -noexit parameter or I get the same behavior. I looked through build options, but didn't see anything like "-noexit", unfortunately.

Short of perhaps calling an existing script from the EXE which defeats the whole point, how would I go about configuring the build so that once executed, it wouldn't exit until one right clicks on the icon and chooses to do so?

If I could figure that out, I think this app will suite my needs. Thanks
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Example of Project I'm Attempting?

Post by Alexander Riedel »

I would suggest these articles.
https://www.sapien.com/blog/2017/07/10/ ... owershell/
https://www.sapien.com/blog/2019/01/10/ ... lications/

You will note the they make clear that your script needs to not exit until you decide to close the app.
I suggest to study the associated sample project.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.