Tag: Try/catch/finally blocks in PowerShell

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

 4,387 total views,  10 views today

 4,387 total views,  10 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