Hi all,
I've set up about 20 filters with labels and activated command file output with variables active.
The command file launches a batch file with one single line:
powershell -NoProfile -executionpolicy bypass -file C:\Users\David\PDWpowershell\pushover4.ps1 %1 %2 %3 %4 >>testlogbatch.txt
-> sole use of this .bat file is thus to call my Powershell script (passing the variables once more) that calls some API's on the net. Return is written in testlogbatch.txt for troubleshooting.
In fact I enabled push messaging on my mobile phone for every message that triggers a filter using a free service
The powershell is only about 100 lines of very simple code to add some more functionality and finally calls the API for creating the push message on smartphone.
This setup works fine and is blazing fast.
There's only one thing that bothers me: whenever two filters are triggered just one after another (with just 1 second delay between both) it seems that the second launch of the same batch file fails because the first command window is still open... Once there is more than 1 second between the messages all is fine.
Anybody a clue on this?
Should I close the command prompt explicitly in my batch file and add a second line that says Exit
Should I use the 'start' command and add this in my first line of the batch file? From what I read I guess this will make sure to start every time an new session once this batc file is called?
START powershell -NoProfile -executionpolicy bypass -file C:\Users\David\PDWpowershell\pushover4.ps1 %1 %2 %3 %4 >>testlogbatch.txt
Thanks!