When Joshua was by Jericho, he lifted up his eyes and looked, and behold, a man was standing before him with his drawn sword in his hand. And Joshua went to him and said to him, “Are you for us, or for our adversaries?”
Joshua 5:13

When the angel appeared to Joshua, he didn't immediately know who it was. It can be difficult even for the most faithful to recognize God's actions and agents. In v14, he asked the angel, "Are you for us or our enemies?" However, the angel didn't answer that question. He replied, "I am the commander of the army of YHVH." Meaning "I am not for you, but you had better be for me!"