What was the role of Polish Armed Forces that were created from former Polish POws in the Soviet Union?

I know that after the Soviet invasion of Poland in 1939, many Polish soldiers were taken as POWs, and when Germany invaded, they were released and formed an army. I was wondering how this army was organized, what was their role and which operations they took part in.