powershell try catch write error to file