He was an ardent royalist, is supposed to have defended ship money and billeting of troops, and joined kingCharles I of England at Oxford on his retreat thither, but he was one of those judges for whose continuance in office the British House of Commons petitioned in 1643. At Oxford he attempted without success to hold a Court of Common Pleas. On 31 January 1643 he received the degree of D.C.L. He was one of the judges who tried and condemned Captain Turpin in 1644, and although the House of Commons ordered Serjeant Glanville, his colleague in that case, to be impeached for high treason, Foster was only removed, and with the four other judges of the Common Pleas disabled from his office “as if dead”, for adherence to the king. He compounded for his estates by paying a large fine. After the death of Charles I, Foster lived in retirement, and, being a deep black letter lawyer, practised in the Temple as a chamber counsel and conveyancer. He had received on 14 October 1656 a license from Oliver Cromwell and council to come to London on private business and stay there, notwithstanding the late proclamation.
Chief Justice
At the Restoration he was at once restored to the bench, 31 May 1660, and, having shown zeal on the trials of the regicides, was presently appointed to the chief-justiceship of the King's Bench, which had remained vacant for want of a suitable person to fill it. He dealt sternly with political prisoners. Many Fifth-monarchy men and the Quakers, John Crook, Grey, Bolton, and Tonge, accused of a plot against the king's life, were tried by him, and in the case of Sir Harry Vane he not only browbeat the prisoner on the trial, but induced the king to sanction the execution against his inclination and word and the petition of both houses of parliament. On 1 July 1663 he tried Sir Charles Sedley for indecent behaviour, and 'rebuked him severely.' He died on circuit, 4 October 1663, and was buried under a tomb bearing a bust of him in robes, at Egham, Surrey.
Private life
Foster married Elizabeth, the daughter of Sir Edward Burton of Bourne, Sussex. He left a son Thomas, afterwards a knight, to whom his house, Great Foster House, Egham, descended.