It is worth noting that when I tried to export my root certificates, I had to use Thumbprint as the file name, not Subject, due to invalid foreign language characters in Unicode. It works:
dir cert:\localmachine\root | Foreach-Object { [system.IO.file]::WriteAllBytes("c:\temp\$($_.Thumbprint).cer", ($_.Export('CERT', 'secret')) ) }
source share