Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Last resort - using a gui to keep my powershell session alive

$
0
0

Hello All,

I've been trying to take this code which watches a service through wmi event - and then restarts it if it gets shut down - and create a service out of it. I tried to compile as service through powergui but I'm pretty sure there's no way to specify the -noexit commands to the C# (or what ever language they use) wrapper they use on there.

That being said I'm thinking of creating a quick GUI window that will keep the powershell session open until a "close" button is clicked. I'd like to have it minimize to tray also which I know is possible by tapping into the .net framework.

Any suggestions to make either of this work? I tried to just write the service in C# using WMI but there's a lot I still don't understand about the language. 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>