There aren't any API's to control the windows service console. If you have Mendix running as a windows service you can stop/start the service remotely using powershell.
Hey Jitze,
I was able to shutdown local application with Java action with following code, I was not able to test it on-premise, but I guess it's should work only what can happen that your CI/CD try to get application running again.
// BEGIN USER CODE
System.exit(0);
return null;
// END USER CODE
Best regards, Slavko
NOTE: this was tested on Mendix 10.11