Was there ever a prophet in Tanach that made a known prophecy and was also referred to as a military commander?
Joshua was visited by a malach of extremely lofty level (though he might not have technically been a prophet). It's also written a few times that God spoke to Joshua, such as in Joshua 1:1-9, 4:2-3, 4:15-16, 5:2, and more. He was visited by a malach who identified himself as the "general of of God" in 5:13. Rashi (5:15) identified the malach as Michael. Joshua wasn't called a prophet by the Sages in the sense that it wasn't his main vocation, but he was granted prophecy at times.
King David was granted prophecy (see last chapter of Shmuel B 23:1-7).
Shlomo was also granted prophecy once when he had the dream in which God promised to make him wise, and, as the king, he was the commander in chief, but he did not fight any notable wars.
King Saul was a military commander, as is known. He was also a prophet, temporarily. See I Samuel 29:24.
Samuel had anointed David as "king". Saul became crazy and was constantly afraid that David would usurp him, so he made numerous attempts to try to kill David. In one incident, David fled to join Samuel at his home. Saul first sent several groups of messengers to retrieve David, and each of these messengers began to prophecy when they approached Samuel. Eventually, Saul, himself went to Samuel, and he also became a prophet.
The Gemora in Megila 14b says that Amasa one of the head Generals of Shauls army Ruach Hakodesh prophecy, and we only know Ester one of the 7 prophetesses had Nevua (prophecy) from a Gezeira Shava (common word that links both passages) from Amasa's Procphecy (Divrei Hayamim 1 12,19):
ותלבש אסתר מלכות בגדי מלכות מיבעי ליה אלא שלבשתה רוח הקדש כתיב הכא ותלבש וכתיב התם (דברי הימים א יב, יט) ורוח לבשה את עמשי
Sifsei Chachamim also quotes Bereishis 45,27 ותחי רוח יעקב with Yaakov that his Nevua came beck from the passuk regarding Amasa
רוצה לומר דרוח היינו נבואה כדכתיב (דה"א יב יט) ורוח לבשה את עמשי: