When Pharaoh shall speak unto you (Exod. 7:9). Scripture states (elsewhere in reference to this verse): Declaring the end from the beginning, and from ancient times things that are not yet done; saying: “My counsel shall stand, and all My pleasure will I do” (Isa. 46:10). The Holy One, blessed be He, declared at the very beginning what the end would be, when He said to Moses: Behold, thou art about to sleep with thy fathers, and this people will rise up, and go astray (Deut. 31:16). They were destined to do so upon Joshua’s death. And will forsake Me, and break My covenant (ibid.), as it is said: And they forsook the Lord, and served Him not (Judg. 10:7). Hence at the very beginning he disclosed what would follow.
R. Phinehas the priest, the son of Hama, stated: One who reads this verse may think that there must be a difference of opinion above (in heaven), since it says: My counsel shall stand, and My pleasure will I do. What is the actual meaning of My counsel shall stand, and all My pleasure will I do? It means that He desires to justify His creatures, as it is said: The Lord was pleased, for His righteousness’ sake (Isa. 42:21). Certainly He does not take delight in proving anyone guilty, as it is said: For I have no pleasure in the death of the wicked, but that the wicked turn from his way and live (Ezek. 33:11). Hence, it is said: All my pleasure will I do.