Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent error message when AppPool is already stopped

I am running the following cmd on my MSBuild using PsEXEC.

%systemroot%\system32\inetsrv\appcmd stop apppool /apppool.name:MyAppPool

If the MyAppPool is already stopped, and try to stop again, I am getting error message.

ERROR ( message:Application pool "MyAppPool" already stopped.

This is stopping my build. How to handle this situation?

If MyAppPool is already started and issue a start again, no error message appears.

like image 868
teenboy Avatar asked Mar 11 '14 11:03

teenboy


1 Answers

Just add "| exit 0"

%systemroot%\system32\inetsrv\appcmd stop apppool /apppool.name:MyAppPool  | exit 0
like image 177
Pavel Avatar answered Sep 20 '22 16:09

Pavel