Search found 18 matches

by jdainsworth
Mon May 03, 2021 9:40 am
Forum: PowerShell
Topic: System Tray Application
Replies: 2
Views: 2335

System Tray Application

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?
by jdainsworth
Tue Apr 14, 2020 12:00 pm
Forum: PowerShell Studio
Topic: Proper way to forcefully terminate a compiled service script
Replies: 6
Views: 1035

Re: Proper way to forcefully terminate a compiled service script

Adding this function, and calling it in my Errorhandler when appropriate works. Thanks,

Code: Select all

FUNCTION Invoke-ForceServiceKill {
	[CmdletBinding()] 
	PARAM ( ) 
	stop-myservice 
	$process = Get-Process -id $pid 
	$null = $process.Kill()
}
by jdainsworth
Tue Apr 14, 2020 11:41 am
Forum: PowerShell Studio
Topic: Proper way to forcefully terminate a compiled service script
Replies: 6
Views: 1035

Re: Proper way to forcefully terminate a compiled service script

That was going to be the next thing I tried, but hoped there might be a "official" way to do so.

Thanks,
by jdainsworth
Tue Apr 14, 2020 11:24 am
Forum: PowerShell Studio
Topic: Proper way to forcefully terminate a compiled service script
Replies: 6
Views: 1035

Re: Proper way to forcefully terminate a compiled service script

The scenario that i am working with is a case where it is impossible to fully initialize the service, and will take human intervention to correct. I would prefer to have the service fail so i can utilize some of our standard system monitoring to detect the failed process, and trigger alerts.
by jdainsworth
Tue Apr 14, 2020 9:22 am
Forum: PowerShell Studio
Topic: Proper way to forcefully terminate a compiled service script
Replies: 6
Views: 1035

Proper way to forcefully terminate a compiled service script

To help you better we need some information from you. *** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. *** Product, version and build: 5.7.174 32 or 64 b...
by jdainsworth
Thu Aug 15, 2019 3:13 pm
Forum: PowerShell Studio
Topic: Issue with Edit Function changing ValidateRange
Replies: 4
Views: 1555

Re: Issue with Edit Function changing ValidateRange

I don't want the end range to be 10, I want it to be [int]::MaxValue. However that is beside the point. I created a range validation by hand, opened the edit window, and it altered a manually created range validation, and specifically changed it to a code breaking value. I would consider this to be ...
by jdainsworth
Thu Aug 15, 2019 10:35 am
Forum: PowerShell Studio
Topic: Issue with Edit Function changing ValidateRange
Replies: 4
Views: 1555

Issue with Edit Function changing ValidateRange

To help you better we need some information from you. *** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. *** Product, version and build: Powershell Studio ...
by jdainsworth
Tue Jan 15, 2019 11:03 am
Forum: PowerShell Studio
Topic: Last character of script being removed when file is saved/signed
Replies: 4
Views: 1650

Last character of script being removed when file is saved/signed

To help you better we need some information from you. *** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. *** Product, version and build: Sapien PowerShell ...
by jdainsworth
Wed Mar 07, 2018 9:32 am
Forum: PowerShell Studio
Topic: Module Deployment Process
Replies: 3
Views: 1976

Module Deployment Process

To help you better we need some information from you. *** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. *** Product, version and build: PowerShell Studio ...