Tag: PowerShell error handling best practices

Exception or Error handling in PowerShell -Try/Catch/Finally Block Example

 4,377 total views,  38 views today

 4,377 total views,  38 views today   In this post I will show that how we can handle the exception in PowerShell coding using the try/catch/finally block and how we can write the error or exception message into the log file.   Exception handling using try/catch/finally block PowerShell example: cls $fileName = “File_Uploading_Report” $enddate = (Get-Date).tostring(“yyyyMMddhhmmss”) $logFileName

Continue reading