The very same metaphor has existed in French since at least the 14th century and is still in common usage:
Il faut battre le fer quand il est chaud.1
Your attempt Faites-le tant que vous le pouvez doesn't convey the same meaning. It's more like "Do it as long as you are able to do it."
You might also say:
Faire quelque chose lorsque les ...
The dictionary Le Petit Robert 2006 gives a French idiom (under the entry "battre") that corresponds exactly with the English "strike the iron while it's hot":
Battre le fer pendant qu'il est chaud: profiter sans tarder d'une situation propice.
In other words: taking advantage of a favourable situation without delay.