try{ Update-UD_Content -StrInputFile $Str-MONINI -OldChar ";" -NewChar ","; } catch { $StrMessage = $_.Exception.Message $IntLine = $_.InvocationInfo.ScriptLine-Number add-Content -Path ($StrErrorLogBaseDir + "\" + $StrScriptName_No_Ext + "_" + $StrNormalizedDate + ".txt") -value "error in Update-UD_Content at $(getdate): $StrMessage-$IntLine" -force; exit 10; }