PowerShell Tip #2

When working with PowerShell , whether it’s for Exchange Server, Exchange Online, Windows or whatever, turning on the Transcript function is a worthwhile option especially if the script is going to be scheduled for daily, weekly, or monthly tasks. The transcript will provide you with an idea of how far the script got or if it possibly encountered errors, you may know how far the script progressed before having issues. This is just one way for troubleshooting a troublesome script.

Remember to start the transcript before any other cmdlet in the script and to stop the transcript when completed, preferably at the end of the PowerShell script. If there are debugging steps, which stop the script from running, make sure to stop the transcript process there as well. Otherwise you will need to run Stop-Transcript manually to stop PowerShell from working with that transcript file.

Microsoft Documentation

Start-Transcript https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-6
Stop-Transcipthttps://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.host/stop-transcript?view=powershell-6

Related Post

CIM to WMICIM to WMI

Years ago WMI was de-emphasized for CIM. Wait. Do you know what those are? CIM – “The Common Information Model (CIM) is an extensible, object-oriented data model that contains information