For a small amount of power (to run a sorting machine for example), a single block path to the sky will still get sunlight to a solar panel at the bottom of the shaft.
For lots of power solar panels or wind turbines on the surface feeding a battery box/ender chest setup that charges batteries. underground end has ender chest/batterybox that receives the full batteries.