The Governor, as commander in chief of the militia, may employ the militia or any part of it in the defense or relief of the state, or any part of its inhabitants or territories, and shall have all the powers necessary to carry into effect the provisions of this code.