The US Senate has approved funding for much of the Department of Homeland Security, which has been partially shut down for weeks, but left ICE without money.