Preheat oven to 350 degrees F.
Spray a skillet with olive oil
Cook onion and corned beef on medium heat until onions are soft and corned beef is slightly browned
Transfer onion beef mixture to a small bowl and set aside
Add olive oil to the pan and add potatoes when the oil is hot.
Cook shredded potatoes 6-7 minutes, then flip and cook the other side for 6-8 more minutes
Season with rosemary, salt and pepper.
Add corned beef and onions and cheese to the pan and stir to mix. Turn off heat and season with salt and pepper.
Spoon mixture into a 8 1/2 x 11 casserole dish.
Make six indentions with the back of an ice cream scoop or large spoon and drop a whole raw egg in each hole. Bake casserole for 20 minutes or until eggs are just set.
Garnish with parsley, if using.