He said, No; but [as] prince of the host of Yahweh am I now come. Joshua fell on his face to the earth, and did worship, and said to him, What says my lord to his servant?
Thus, despite the fact of our ignorance of just HOW or WHEN God revealed all of the instructions which Joshua evidently followed, he did indeed have Divine guidance in the conquest of Canaan.