This answer was copied from my answer to Are there any disadvantages to using your companions for transporting Power Armor, and slightly updated.
Fixing the armor can be a hassle, but it can be done. You may or may not need to have the companion get out of the armor, depending on your situation.
At a stand with an associated frame, you can only work on the pieces of armor on the frame associated with that stand, or ones in your inventory.
Associating a Frame
The frame associated with the stand seems to be the last one you were wearing, unless someone else has worn it since. This means that your companion's armor will not be associated with the frame while they are wearing it. Walking up to a frame while wearing armor and attempting to interact definitely associates it.
So, if you want to switch the associated frame to your companion's frame you'll have to tell them to get out of it and get in it yourself. To tell them to get out, talk to them. The companion can only enter armor from the back, so if they are backed up against something you might need to tell them to move first, and you might need to move the armor before they can get in it. Companions also sometimes have pathing issues trying to find the back of the armor, so it can be helpful to direct them to "go" to its side, then its back, and then in.
Fixing Armor not on the Associated Frame
This only works if you already have a frame associated with the station, so if your companion's frame is the only one around they'll have to get out.
Take the pieces from your companion, walk over to the power armor station, repair them, and then give them back.
To take pieces, trade with your companion and simply take them. To put them back on the frame, trade with your companion, give them the pieces, and tell them to equip them. While doing this, I've noticed a bug regarding the companion's carry weight. It seems like it doesn't subtract the weight of the power armor piece from their encumbrance total when they equip it, so it might tell you that they can't carry any more before you give them all their armor. To fix this, leave the trade dialog, and re-initiate it.