How to output console or PowerShell transcript to a file in Windows

Console output copypaste

Every now and then, you run into a situation, where you’ll need to somehow output the console output of running a console application. I’m actually going to argue it happens a lot more often than one would think – in my case, any time a customer requires a webjob or a function, that one would normally deploy to Azure, being ran on the servers of the customer.

Problem

Something breaks or the app crashes, and the error is logged to event log… But just the error, not the whole transcript. You’d like to get it all, to figure out what’s actually going on, but event log is not the way to go.

Or, you’re investigating an error that happened to someone else, but only get screenshots of console or event log errors, whereas you’d want to get all the possible information about the problem instead.

What to do?

Solution: redirect the console output directly to a file

Continue reading