Stephen Antram, 37, admitted two charges of having a weapons designed or adapted for the discharge of a noxious liquid under the Firearms Act 1968.
Portsmouth magistrates imposed an 18-month conditional discharge for both offences.
He was caught in Waterlooville on February 17 and charged with the offences.
Antram, of Prospect Lane, Havant, must pay a £20 victim surcharge and £85 prosecution costs.
Woman, 44, whose large Dobermann dog mauled girl, 3, on Leigh Park street released back into neighbourhood by police
Unidentified woman’s body found in water as Hampshire police investigate ‘unexplained’ death
Plans for redevelopment of Knight and Lee in Southsea get the green light - and work will begin soon, vows developer That Group
Seven - including five teenagers - arrested after Lower Drayton Lane burglary in Portsmouth
Portsmouth businessman turns 'detective' to catch brazen men who took air conditioning units feels ‘unsafe’ after men return to warehouse
Both the stun gun and CS spray must be forfeited and destroyed, magistrates ruled in court.
His plea was taken into account when he was sentenced.