York Wilkinson, of Shaw Court, Brownhills Road, was travelling through the station when he noticed the operation being conducted by Safer Travel on October 28.
Officers spotted Wilkinson back away from their knife arch and head off in the other direction. He was detained and handed over a kitchen knife and a bag of cannabis.
The weapons and drugs were seized and the 33-year-old was arrested at the scene and remanded in custody overnight until his appearance at Dudley Magistrates Court on October 29.
He was then sentenced to six weeks in prison for possession of a bladed article and possession of drugs.
Inspector Rachel Crump, from the Safer Travel police team, said: “This is a welcome sentence for a man who was in possession of a dangerous weapon and had made failed efforts to avoid detection by our officers.
“We do not condone anyone carrying weapons on the railway and we will continue to carry out knife arch operations across stations in the region to keep passengers and staff safe.
“We hope this sends a clear message to anyone considering carrying a weapon when they’re travelling that they will be caught and prosecuted, and in this case, end up in prison the very next day.”
Safer Travel conduct knife arch operations at transport hubs across the region with support from local policing teams at West Midlands Police and British Transport Police.