$exportfile = "C:\foo\myfile.txt"
if (Test-Path $exportfile) {
<do something>
}
else {
<do something else>