General logging question with powershell and CtW

Apologies for what is undoubtedly a noob question, but what is the cleanest way to output from a user deployment task script so that it writes into the CtW log file associated with that renewal ?

I’ve seen your example for writing to stand alone log files (which is great for debugging) but I’d like some output to go directly to the CtW logs if possible so it can be retained.

Using Write-Output will write to the standard output, which we redirect to the log file, so that should be enough for what you need. If you also use Write-Error to indicate a failure this will mark the task as failed.