-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chocolatey-misc-helpers: Start-WaitAndStop remake #364
base: master
Are you sure you want to change the base?
chocolatey-misc-helpers: Start-WaitAndStop remake #364
Conversation
Hi @virginviolet. First thanks for finding this and wanting to make it better. I put a few comments in on two of the files. I only put a few minutes into looking at this but will look at it deeper in the future and after you've seen my comments. |
Thanks. |
For the record, I just discovered that core-extentions has a helper that addresses the same issue as Start-WaitAndStop. Remove-Process, that is. |
I had the issue of
Start-WaitAndStop
only working if the process appeared within 10 seconds (the timer set in Start-WaitAndStop.ps1). So I remade the functions my way.It bothered me also that, even when you got the function working as intended, the
** Stopping $ProcessName process...
message would not appear, as it's executed in an isolated environment (as I understand it). Granted, I haven't tried it in an actual Chocolatey install, so maybe I could be wrong.To address this, I added a Warning message in
Start-WaitAndStop.ps1
that saysWaiting to stop '$ProcessName'...
.I also created a new function,
Receive-WaitAndStop
that grabs the output from Start-WaitAndStopActual. I don't know when this would ever be useful, but here is how you could use it.Other changes:
Start-WaitAndStop -Seconds 600
(Default is300
).-Interval 2
(default is now3
).