Anti-virus firms and IT departments struggled all week to get the Petya ransomware outbreak under control.