Astronauts finished up a spacewalk at the International Space Station for the second week in a row.

On Wednesday, NASA astronauts Reid Wiseman and Butch Wilmore ventured out to replace a failed electrical device. The repair should restore full power capability to the 260-mile-high outpost.

Spacewalking astronauts replaced a failed electrical unit at the International Space Station on Wednesday, restoring full power to the orbiting lab.

The space station had been operating since spring with only seven of its eight solar-power channels. Wednesday's work by Reid Wiseman and Butch Wilmore - NASA's second spacewalk in two weeks - brought the energy capability back up to 100 percent.

The spacewalkers encountered balky bolts but still managed to complete the job in the allotted time, with less than two minutes to spare.

"Yoo-hoo!" they cheered as NASA declared victory.

The voltage regulator shorted out in May but could not be replaced until now because of a yearlong hiatus in nonemergency spacewalks by NASA. The stoppage was caused by spacesuit problems, most notably a flooded helmet that nearly cost an astronaut's life in 2013.

Wiseman took part in the Oct. 7 spacewalk that jump-started NASA's outside maintenance, accompanied by a German. This time, Wiseman was joined by Wilmore, who made his first spacewalk.

To avoid an electrical shock, the two spacewalkers waited until darkness before attempting to remove the old voltage regulator, so there would be no discharge. They took in the view 260 miles below as they waited for the space station to fly into the night side of Earth.

"I see Cairo!" Wiseman said. "Can't quite make out the pyramids, though."

Sunset came over Kazakhstan and China, and Wiseman began to undo the bolt holding down the bad regulator. His pistol grip tool failed to loosen the bolt. "I can feel it binding up," he said. A ratchet wrench - along with some muscle - did the trick.

Wiseman removed the 330-pound boxy regulator from its slot and, with Wilmore's help, popped in the new one. But once again, they ran into bolt trouble, this time in securing the new device.

The minutes ticked away as Mission Control debated how much longer to keep up the effort, before stopping for the next orbital sunrise. With less than 10 minutes remaining, flight controllers advised Wiseman to try tightening the bolt with the ratchet wrench. It worked. "Outstanding news," Mission Control radioed.

Flight controllers immediately checked out the newly installed system, with less than three minutes to go. Success was declared with one minute and 45 seconds remaining.

The voltage regulator - officially called a sequential shunt unit or SSU - is needed to keep excess power from its designated solar wing, from overloading the station system. Power is regulated at about 160 volts.

After the May breakdown, NASA transferred space station systems dependent on the failed power channel to a backup. No operations were hampered, but NASA wanted that channel operating again for full capability and redundancy.

With their main job completed, the spacewalkers got started on moving camera and wireless radio systems. The relocations are needed to get ready for the eventual arrival of new commercial crew vehicles. That's still a few years away.

A Russian spacewalk, meanwhile, is on tap for next Wednesday.