The near party-line vote was 50-49 with one Republican senator, Susan Collins of Maine, supporting his confirmation.