Yuuzhan Vongs can be affected by the Force via non-direct means. Direct telekinetical shoves, chokes, mental attacks, sorcery, and things like that can't affect Yuuzhan Vongs - they are beyond Force influence.
However, Force Lightning and Electric Judgement do not affect the opponent with the Force itself - rather with the product of the Force channeling. The electrical energy created from the Force. That's very reasonable and logical.
That would also mean powers like pyrokinesis can also affect them, but that was never shown. Syndi is right, though, but I wouldn't exactly name that "Yuuzhans are affected by energy"; that's just way to word it tho.
Fairly sure it isn't that simple. Is it a sword? Because the reason lightsabers can contain lightning is that they're energy and with how they work blah blah nerd science.
He lacks the Force needed to contain lightning regardless, especially like Revans when he can perform lightning storms that shoot out of the sky and shoot multiple bolts over a large area.