text: Media playback is not supported on this device
  Jed Wallace almost broke the deadlock midway through the first half of the replay but his brilliant volley was saved by Shots keeper Phil Smith.
  Molesley wasted a good chance for the hosts after the break when he headed wide while Dan Holman had a shot saved.
  But Molesley bundled the ball home after a huge scramble from a corner.
  The goal came with 10 minutes remaining and sparked celebrations inside an atmospheric Electrical Services Stadium.
  Media playback is not supported on this device
  It was an incredibly scrappy goal, with Portsmouth spurning several opportunities to clear the corner.
  The last of these fell to Alex Wynter, who was off balance on the line and could not manage to kick the ball to safety.
  The first tie had finished 2-2, with Molesley also on the scoresheet at Fratton Park.
  And after the victory on Wednesday, the midfielder said: "You can see what it means to everyone. The FA Cup gives a lifeline to so many clubs and boy do we need it. It was a gritty performance, a blood and thunder cup tie and that suited us."
  The result means that Pompey are still looking for their first victory in the FA Cup since they defeated Tottenham in the semi-final of the 2010 competition.
  The Shots can now look forward to testing themselves against a League One side when Rochdale visit on 7 December.
  Aldershot Town manager Andy Scott told BBC Surrey:
  "It's fantastic - we've played two games against a big club like Portsmouth and been the better side over those two games.
  "It's been a fantastic effort from the lads and it's great to have another clean sheet. We are on a good run of form and that is absolutely brilliant.
  "They've always believed in themselves and we have had a tough time but they keep working ever so hard in training and they are a great bunch to be around."
  Match ends, Aldershot Town 1, Portsmouth 0.
  Second Half ends, Aldershot Town 1, Portsmouth 0.
  Attempt missed. Danny Hollands (Portsmouth) left footed shot from outside the box is too high. Assisted by Nigel Atangana.
  Foul by Danny Hollands (Portsmouth).
  Nabi Diallo (Aldershot Town) wins a free kick on the right wing.
  Corner,  Aldershot Town. Conceded by Alex Wynter.
  Attempt saved. Miles Storey (Portsmouth) right footed shot from the right side of the box is saved in the bottom right corner. Assisted by Jed Wallace.
  Foul by Jed Wallace (Portsmouth).
  Jordan Roberts (Aldershot Town) wins a free kick in the defensive half.
  Jaydon Gibbs (Aldershot Town) is shown the yellow card for a bad foul.
  Ricky Holmes (Portsmouth) wins a free kick on the left wing.
  Foul by Jaydon Gibbs (Aldershot Town).
  Attempt missed. Ricky Holmes (Portsmouth) right footed shot from outside the box is too high from a direct free kick.
  Danny Hollands (Portsmouth) wins a free kick in the attacking half.
  Foul by Mark Molesley (Aldershot Town).
  Substitution, Portsmouth. Miles Storey replaces Craig Westcarr.
  Substitution, Portsmouth. Patrick Agyemang replaces Ryan Taylor.
  Goal!  Aldershot Town 1, Portsmouth 0. Mark Molesley (Aldershot Town) left footed shot from very close range to the centre of the goal following a corner.
  Attempt blocked. Glenn Wilson (Aldershot Town) right footed shot from very close range is blocked.
  Attempt blocked. Joe Oastler (Aldershot Town) right footed shot from the centre of the box is blocked.
  Attempt blocked. Brett Williams (Aldershot Town) header from very close range is blocked. Assisted by Jordan Roberts with a cross.
  Corner,  Aldershot Town. Conceded by Paul Jones.
  Attempt saved. Dan Holman (Aldershot Town) right footed shot from outside the box is saved in the top right corner. Assisted by Jaydon Gibbs.
  Attempt missed. Manny Oyeleke (Aldershot Town) right footed shot from outside the box misses to the right. Assisted by Kieran Forbes.
  Corner,  Aldershot Town. Conceded by Paul Robinson.
  Substitution, Portsmouth. Ben Chorley replaces Jack Whatmough.
  Attempt saved. Dan Holman (Aldershot Town) right footed shot from very close range is saved in the bottom right corner. Assisted by Joe Oastler.
  Jack Whatmough (Portsmouth) is shown the yellow card for a bad foul.
  Foul by Jack Whatmough (Portsmouth).
  Dan Holman (Aldershot Town) wins a free kick on the left wing.
  Attempt blocked. Nigel Atangana (Portsmouth) right footed shot from outside the box is blocked.
  Attempt blocked. Jed Wallace (Portsmouth) right footed shot from the right side of the box is blocked.
  Attempt missed. Manny Oyeleke (Aldershot Town) right footed shot from outside the box misses to the left. Assisted by Kieran Forbes following a corner.
  Corner,  Aldershot Town. Conceded by Paul Jones.
  Attempt saved. Brett Williams (Aldershot Town) left footed shot from outside the box is saved in the bottom right corner. Assisted by Nabi Diallo with a headed pass.
  Danny Hollands (Portsmouth) wins a free kick in the defensive half.
  Foul by Manny Oyeleke (Aldershot Town).
  Joe Oastler (Aldershot Town) is shown the yellow card for a bad foul.
  Ricky Holmes (Portsmouth) wins a free kick on the right wing.
  Foul by Joe Oastler (Aldershot Town).
target: Non-league Aldershot Town will play Rochdale in the second round of the FA Cup after Mark Molesley struck a late winner against League Two Portsmouth.