Moved Test-Path

Removes error from console. Script was testing if file existed before
file could exist during initial loop.