Severity 3 not appearing in red in log

Topics: Archive - General
Dec 18, 2014 at 3:46 AM
Hi,

What should be made to get that error appearing in red in the log?
Write-Log "Echec dans la copie des fichiers pour la trousse manuelle" -Severity 3
Thanks,
Developer
Dec 18, 2014 at 6:25 AM
Model your Write-Log entries after the other entries in the toolkit. If you have a custom function you wrote, then make sure to get the name of the function into a variable (ex: ${CmdletName}) like the functions in the toolkit do and then make sure to pass this parameter to Write-Log: -Source ${CmdletName}

Also, make sure you configured the XML config to create CMTrace format log files if you want the colors.
Dec 18, 2014 at 10:58 AM
Is it an easy way to return a function name in a variables?
My XMl is already set to CMTrace.
So If I'm understanding correctly, I only need to add the function name?

I will give it a try.
Developer
Dec 18, 2014 at 12:45 PM
Every function in the toolkit sets the function name to variable ${CmdletName} as the very first thing. Just copy what we do for your own function. Or you can hard code it in. Doesn't really matter.