A modern idiom is "curl https://$THING/ | sudo /bin/bash "
And the arguments around it being secure because it's https...