Wondering if folks can direct me to the correct way to to do this. Currently I'm working on a custom DSC resource for installing SQL Server and I am trying to write troubleshooting messages to the DSC Windows log (ideally the Operational log, but I figure Analytic or Debug would work the same way). I'm not finding any good web hits on how to do this and it feels like I'm missing something obvious. Can anyone direct me to a "how to" or similar guidance for this?
You can use Write-Verbose and Write-Debug in your DSC resource code, and DSC will take care of the rest. If I remember correctly, Verbose output goes into the Operational log, and Write-Debug goes into the Debug log, but don't quote me on that. 🙂 I don't have a system up where I can quickly double check that at the moment.
Odd that, because I'm using Write-Verbose, but the information doesn't seem to be hitting the Operational Log. I can revisit it, make sure I'm doing what I think I'm doing. And, just to make sure I'm on the correct track, will it post an error to those logs if I use Write-Error?
Check out the link I just posted in the edit to my last reply. According to that, Verbose output goes to the Analytic log, and Errors go to the Operational log. (Write-Debug, I assume, goes to the Debug log.)