Hi everyone,
I know this question has been asked a thousand times before and has quite a few answers, I just couldn't really find what i was looking for so here goes.
I have an application that I need to restart if it gets shut down (either by crash or system restart). Pretty simple I know but I also need to be able to load a file in it and then start the applications server. Now I can do this in a batch script but why would I want to do that when I can use the awesomeness of powershell?
For example, in a batch file I can do the following:
appname.exe -file <filename> [-delimiter <comma in this case>] -port 1234 -launch
(NOTE: "-launch" is what starts the server part of the application)
Honestly I haven't really tried it like this in powershell yet but started to research it. I've found hundreds of ways of doing this and a lot revolved around waiting for the app to stop which I don't need.
The reason I would like to do this is I'm lazy. Plus if I ever get abducted by aliens (I don't use the bus scenario cause that could actually happen!) the process will continue.
Any thoughts or input on this would be appriciated.
Thanks!