God told Moses, "Look at me. I'll make you as a god to Pharaoh and your brother Aaron will be your prophet.
You are to speak everything I command you, and your brother Aaron will tell it to Pharaoh. Then he will release the Israelites from his land.
At the same time I am going to put Pharaoh's back up and follow it up by filling Egypt with signs and wonders.
Pharaoh is not going to listen to you, but I will have my way against Egypt and bring out my soldiers, my people the Israelites, from Egypt by mighty acts of judgment.
The Egyptians will realize that I am God when I step in and take the Israelites out of their country."
Moses and Aaron did exactly what God commanded.