Skip to content

Instantly share code, notes, and snippets.

@rpunt
Last active December 14, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpunt/5134886 to your computer and use it in GitHub Desktop.
Save rpunt/5134886 to your computer and use it in GitHub Desktop.
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