Like his Wittelsbach father and grandfather, William V was a strong supporter of the counter-reformation. He secured the archbishopric of Cologne for his brother Ernest with his campaign in 1583; his brother Ferdinand commanded the Bavarian army in the first 18 months of the Cologne War in an effort to secure the Electorate. Eventually, the Spanish army, under the command of Alexander Farnese, Duke of Parma expelled the Calvinist contender for the Electorate, Gebhard Truchsess von Waldburg, and Ernst secured sole possession of both the Electorate and the Archdiocese of Cologne. This dignity remained in the possession of the family for nearly 200 years. Two of William V's sons also followed ecclesiastical careers: Philipp Wilhelm of Bavaria became the Bishop of Regensburg and eventually a Cardinal, and Ferdinand of Bavaria succeeded his uncle as Archbishop of Cologne. In 1591, Philipp Wilhelm expelled Salzburg from the Berchtesgaden Provostry, the future possession of his son Ferdinand.