I am a heavy user of Tasker so I checked there. I don't see a way to do this directly. I suspect, at the very least, you would need root access. Even then, shutting down the device on a whim feels ...