If I'm hiring for a programmer position, and I have a man and a woman who have applied, and I don't hire the man
because he's a man, that's discrimination. (Note that this is identical to hiring the woman
because I don't have enough women.)
What I meant by "expose and remove discrimination" is point out that the team atmosphere is hostile to women, and start disciplining people until that changes. Or, realize that Fred is automatically rating resumes lower if it has a feminine name, and confronting Fred on that. Or... you get the idea. If there's something going on (other than lack of viable candidates) that leads to fewer female programmers, find it out and fix it.
The remaining problem is lack of viable candidates. To fix that you have to fix problems outside of your own organization - problems in the education system, in homes, and in society in general. That's a tall order, and it's beyond any one person's power. But still, when you see obstacles that differentially harm females (or blacks, or gays, or whoever), don't just ignore them. Do what you can to expose and try to fix them.