the duke made him his private secretary upon being appointed master-general of the ordnance in 1819, and he continued to serve in this capacity when wellington was made commander-in-chief (1827), prime minister (1828), foreign secretary (1834), and commander-in-chief again (1842).