Output Trace Calls from Imported C# Module To Deployment Task Log

I am importing a .NET C# dll using powershell Import-Module. How can I output the Trace calls as part of my deployment Task Logs.

Thanks

Hi Keith,

Thanks for reaching out. This falls into the .Net/Powershell realm and there’s nothing built-in in Octopus to show such trace info. As long as you can do this in Powershell and output the info to the console, it should how up in your deployment logs.

These 2 posts seem like a good starting point to start showing that info on the console:

Now if already have some code that allows you to see that info on your Powershell console, but that’s not showing up in Octopus, let us know how are you getting the trace so we can reproduce it in our end.

Thanks,

Dalmiro

Thanks I was able to solve this my making a TraceListener in my C# code that accepts a PSObject. I then Invoke a Write method on that object and can use Powershell to choose the Write- call I want based on my logging category.

Hi,

Thanks for letting us know! I’m pretty sure nobody else did (or at least asked about) this before. If you write a blog post about it, we’ll make sure to forward people with similar requests to it.

Cheers

Dalmiro