Brickpi shutdown sequence

Will turning off the switch on the BrickPi issue a shutdown command to the RaspberryPi to shutdown gracefully or is it just like pulling the plug and not recommented?