Perashat Vayelekh, recounts the events of the final day of Moshes’ life on Earth. He addressed the people, saying that he is 120 years old that day, and could no longer lead them, and G-d had told him that he was not permitted to cross the Jordan River together with them. Instead, He reassures the people that G-d and Joshua will guide them and all of their enemies will be destroyed.
Moshe promises in his talk that G‑d will vanquish the inhabitants of Canaan as He did to the Emorites and Bashanites, and all those who had challenged the Israelites along the way. Moshe exhorted the Israelites to be strong and courageous, and not fear their enemies; for G-d would go with them and would not forsake them. The Israelites would dispose those nations according to the instructions that Moshe had commanded them.
Moshe, in the sight of the people, summons Joshua and tells him to be strong and courageous, for he would go with the people into the land that G-d had sworn to their fathers and G‑d will be going before him and will not forsake him. Moshe then wrote the entire Torah and gave it to the Kohanim (priests) and the Israelite elders.
Moshe gives the commandment of Hakhel (assembly), whereby every seven years, during the holiday of Sukkot which follows the Sabbatical year, all men, women, children, and resident aliens assemble so that they may hear and learn, when sections of the Torah are read publicly, and observe the law that G-d has commanded.
G-d instructs Moshe, as the day of his death was approaching, that he should call Joshua to enter the Tent of Meeting together with him, so that G-d might instruct Joshua. G‑d appeared to them both and told Moshe that he was about to lay down next to his forefathers, and that a time will come when the Israelites, once they settle the land, they will abandon G‑d, break the covenant and stray after alien gods. At that time, G‑d will hide His countenance from the nation, would forsake them, and they will be subjected to much evils and troubles.
G-d, therefore, directed Moshe to write a song and teach it to the Israelites so that the song might serve as a witness for G-d and will serve as a reminder for them to bring them back to faithfulness. When many harms will have come upon the Israelites as a consequence of their wicked actions, they will claim that the misfortunes are befalling them because G‑d has abandoned them due to their transgressions. At that time, the song which Moshe and Joshua wrote will bear testimony that these events are in fact penalty for their sinning behavior.
So Moshe wrote the song that day and taught it to the Israelites.And G-d empowered Joshua to be strong and courageous, for he would bring the Israelites into the land that G-d had sworn to them, and G-d would be with him.
Moshe finished writing the Scroll of Torah and gave it to the Levites. He instructed them to place it beside the Ark of the Covenant, which contained the Tablets, so that it might serves as a witness for the people. Moshes then gathered the elders, the officers and the entire nation to assemble to hear the song, chastising them for being stiff-necked, scolding them in advance for the wicked deeds they are sure to commit in the future. He would call upon the heaven and earth to be witnesses that the Israelites were forewarned regarding their fate.
For Moshe said that he knew that after his death, the Israelites would deal corruptly and turn away from the commandments, and evil would befall them because they would do that which was evil in the sight of G-d. And Moshe spoke to all the assembly of Israel all the words of the song until the end.