Does posse comitatus restrict military use against foreign invaders? Wasn’t posse comitatus only to prevent use against US citizens?
Nope.
Even if it were purported to, the Constitution mandates protection of the States from invasion.
Wasn’t posse comitatus only to prevent use against US citizens?
Actually, not really.
There's a huge exception right at the beginning for (a) anything in the Constitution, and (b) an act of Congress.