Convert Transcript to Script

During my PowerShell scripting best practices at Techmentor last week I mentioned a function I had to convert a PowerShell transcript to a script file. Since there’s very little difference between an interactive session and a script, parsing the transcript can yield 80% or more of a script very quickly. I wrote such a function several years ago. What I was really thinking about was my convert history to script function. But, since I mentioned it and a few people have asked, I’ve dusted off the transcript to script function and polished it up for PowerShell 2.0. Continue reading