Tag: Error Handling in PowerShell

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

 6,513 total views,  26 views today

 6,513 total views,  26 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 = $fileName

Continue reading