The legal process leading up to a court-martial, including investigations, charges, and preliminary hearings.