Do the same as any other country. Enact immigration rules for roles. Whilst Switzerland relies of foreign labour, foreign labourers rely on Switzerland. Do you think a sudden exodus of labourers and a dearth of jobs will be fixed overnight? Of course not, a policy will be put in place and business will resume as normal.
But immigration will be hosted controlled rather than mandated.