I also have slightly bad knees.
I find it starts to hurt a lot quicker if I grind along at a slow cadence and high pressure on the pedals, I've learnt the painful way I've a maximum pressure on the pedals I can get away with.
But it also start to hurt if I spin at a high cadence for to long, I've now a maximum number of revs I can get away with.
Putting those two together, it's best if I ride at a slowish cadence, 60-70 rpm down from my more normal 75-85 rpm, but also keep a light pressure on the pedals at all times, so I now say "I've learnt to spin slowly" ......
You need to experiment a little on altering you cadence/pedal pressure a little each ride and see if it lessens the amount of pain your in.
It's little things like .....
Take it easy for the first couple of miles as they are your warm up, this is when I try and set my cadence/pedal pressure for the rest of the ride.
Don't attack hills, it has become a case of how little stress/strain you put on your knees while climbing. That's an easy to remember as more stress/strain equals more pain.
Try and stick within your limit, your better doing a very easy 5 miles per day rather that a fast 10 miles and then suffering for 2-3 days. That's the annoying one as I still want to do +50 mile days but end up hurting to much if I try.
An electric bike will probably lower the stress/strain on your knees and let you out more often/further.
Luck .........
