Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Writes a log of the console output from a powershell script to $PWD. Very useful for unattended scripts.
$log=Join-Path (Get-ChildItem $MyInvocation.MyCommand.Definition).Directory (Get-ChildItem $MyInvocation.MyCommand.Definition).Basename
Start-Transcript "$log.log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment