Preheat the oven to 350 degrees F (175 degrees C).
Lay out 4 squares of aluminum foil. Place one cube steak onto each piece of foil. Spread margarine over the steaks, and season with salt and pepper. Layer one sliced potato over each steak, and a few rings of onion. Season again with salt and pepper if you like. Fold the foil around the food, and seal into a packet. Place packets onto a baking sheet.
Bake for 45 minutes in the preheated oven, until the beef is no longer pink, and the potatoes are tender. Open carefully, as hot steam will be released.