I am new to this sight, but since space being a vacuum there is little to no air resistance at all making a windmill spin forever. There is no wind in space however, if you spin it once, it should keep spinning for a long long time. Now to create energy in a windmill you need the propeller blades to turn a rotor and with almost unlimited spinning time on the propellers you could constantly make energy.
I don’t understand space that much and I hope it is not a stupid question, so please take in mind that I little to nothing about space and this might be too idiotic of a question to answer.