Relative Content

Tag Archive for powershelltry-catchexit

Powershell to continue graceflly in case of a try catch

Appologies, this might be a simple thing, but I can’t get it working!! I have a much bigger script for the demo purposes I have simplified this. Basically, what I want is that PowerShell to continue and return code 0 and do the write-host even if there is a try catch e.g. in this case I want json_template to print with the Message that includes the error message but the other fields are empty. Currently when I run the script, I get this: