In a medium sized mixing bowl, mix together ground beef, garlic powder, onion powder, worcestershire sauce, salt, and pepper.
Form beef into patties slightly larger than the bread slice you'll be using, they'll shrink when cooked.
Using any pan, cook the patties on medium heat on both sides until there's no pink in the middle.
In a small bowl, mix the butter and mayonnaise until combined.
Spread the mayo/butter mixture on each piece of sourdough on one side each.
Using a pan, place a slice of buttered sourdough into the pan, butter side down. Place 1 slice of swiss cheese on the dry side. Add caramelized onions over the cheese. Place the beef patty over the onions and another slice of swiss cheese. Finally, place another piece of sourdough with the buttered side up.
Cook until golden brown and the cheese is melted. Serve immediately.