This - the non-portable aspect - is what irks me the most.
Especially for enterprise developers. Since most of the software we develop is under NDA, we cannot put any of it online to showcase our skills.
I've had to do 3 different take-home "coding exercises" over the last 10 days. 1 was for a Hedge Fund, another for a Real Estate company and a 3rd for an Accounting SaaS company.
I'm in the process of publishing these coding exercise solutions after polishing it up a bit more onto my github profile. Still, I feel like this will also be a waste, because like OP says, most companies have their own specific "Coding tests" and wouldn't take an already coded solution to accept skills and experience of the candidate.