That is what I am wanting to do but want to know if a particular slide switch has the correct length of throw.I've been using slide switches for my yard turnouts for decades. The reason for this choice primarily is for last second throwing of the turnouts when shuffling cars. Ground throws take to long to get the finger nail under it and Tortoise Machines are to slow for those last second realization that a turnout needs to be thrown.
I mount mine in the bench top by cutting out a rectangular hole so only the slide nub is sticking up. I connect it to the turnout with a paper clip bent just enough to provide adjustment if needed. I use the DPDT contacts for powering the frog and eventually dwarf signals.
I would provide a picture but I'm away from home right now posting with my Android.