Foyle was appointed as manager of Conference Premier side York City on 24 November 2008, following the club's sacking of Colin Walker.
Foyle's first game in charge finished in a 1–1 draw at his home town club, Salisbury City, who were managed by his former Southampton teammate Nick Holmes.
He said he was pleased with how the players reacted to his ideas following the match, although he branded some of the team as "weak-hearted" following a 2–1 defeat to Altrincham in December.
He managed York to the 2009 FA Trophy Final at Wembley Stadium on 9 May 2009, which was lost 2–0 to Stevenage Borough.

Foyle won the Conference Manager of the Month award for November after York won four league games and progressed to the FA Cup third round.
After York finished the 2009–10 season in fifth place, he guided the team to the 2010 Conference Premier play-off Final at Wembley, where they were beaten 3–1 by Oxford.
He resigned on 24 September with York 15th in the table, 10 games into the 2010–11 season.
Following this, his assistant manager at York, Andy Porter, commented Foyle had been "sending his CV off everywhere" and was interviewed for the position of manager at League Two side Hereford United, being placed on a shortlist of seven.
He was placed on a four-man shortlist for the Mansfield Town managerial vacancy in December.
Foyle was appointed as manager of Conference Premier side York City on 24 November 2008, following the club's sacking of Colin Walker. Foyle's first game in charge finished in a 1–1 draw at his home town club, Salisbury City, who were managed by his former Southampton teammate Nick Holmes. He said he was pleased with how the players reacted to his ideas following the match, although he branded some of the team as "weak-hearted" following a 2–1 defeat to Altrincham in December. He managed York to the 2009 FA Trophy Final at Wembley Stadium on 9 May 2009, which was lost 2–0 to Stevenage Borough.
Foyle won the Conference Manager of the Month award for November after York won four league games and progressed to the FA Cup third round. After York finished the 2009–10 season in fifth place, he guided the team to the 2010 Conference Premier play-off Final at Wembley, where they were beaten 3–1 by Oxford. He resigned on 24 September with York 15th in the table, 10 games into the 2010–11 season. Following this, his assistant manager at York, Andy Porter, commented Foyle had been "sending his CV off everywhere" and was interviewed for the position of manager at League Two side Hereford United, being placed on a shortlist of seven. He was placed on a four-man shortlist for the Mansfield Town managerial vacancy in December.
Martin Foyle