About Me

My photo
This is a blog for John Weber. One of my joys in life is helping others get ahead in life. Content here will be focused on that from this date forward. John was a Skype for Business MVP (2015-2018) - before that, a Lync Server MVP (2010-2014). I used to write a variety of articles (https://tsoorad.blogspot.com) on technical issues with a smattering of other interests. I have a variety of certifications dating back to Novell CNE and working up through the Microsoft MCP stack to MCITP multiple times. FWIW, I am on my third career - ex-USMC, retired US Army. I have a fancy MBA. The opinions expressed on this blog are mine and mine alone.

2011/08/05

Handy PowerShell Transcript concept

A co-worker of mine put up this blog entry today, I like it.  I too have closed the PowerShell window before I really wanted to.  I use the F7 key, and the up/down arrows, but there is nothing like a literal log, especially when it comes to working up specific elements of a complex (or even brute force) script.  My thanks to Mr. Jaworski to putting this together – his technique works  on every PS install I have tried it on (so far Hot smile).

I modified the instructions Scott lays out, because I don’t like having an unlimited growth file.  I also did not see the point, however well taken, to some of the preliminary setup.  So, I distilled down to one line:

start-transcript "c:\PS log $(get-date -f "yyyy-MM-dd HHmm").txt”

This simple one liner gets you this:

image

The resulting file looks like this:

image

Note that the date/time format is in something *I* like, so you might want to change that around a tad.  But all the nice details are there.

Of course, you will need to “stop-transcript” when you get done.

YMMV

No comments:

test 02 Feb

this is a test it’s only a test this should be a picture