There is a little known law that those who oppose Trump’s executive action have forgotten about. It’s 8 U.S. Code § 1182 which talks about Inadmissible aliens and states in part:
Suspension of entry or imposition of restrictions by president. Whenever the president finds that the entry of any aliens or of any class of aliens into the United States would be detrimental to the interests of the United States, the president may, by proclamation, and for such period as he shall deem necessary, suspend the entry of all aliens or any class of aliens as immigrants or nonimmigrants or impose on the entry of aliens any restrictions he may deem to be appropriate.
So it seems that if the courts properly apply this law, the President’s order will be upheld. Some parts could be struck down concerning green card holders, but the rest will be upheld.
I’d like to point out that Obama used this same law to stop processing requests from Iraqi refugees for six months in 2011. Jimmy Carter canceled visas and banned immigrants from Iran during the hostage crisis in 1980.