{"id":1242,"date":"2011-03-21T11:22:53","date_gmt":"2011-03-21T15:22:53","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1242"},"modified":"2011-03-21T11:22:53","modified_gmt":"2011-03-21T15:22:53","slug":"convert-transcript-to-script","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/","title":{"rendered":"Convert Transcript to Script"},"content":{"rendered":"<p>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 <a href=\"http:\/\/jdhitsolutions.com\/blog\/2011\/01\/convert-history-to-script\/\" target=\"_blank\">function<\/a>. 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.<!--more--><\/p>\n<p>This function is merely intended as a rapid prototyping tool, taking PowerShell expressions from your transcript and generating a PowerShell script file. <\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Convert-TranscriptToScript {<\/p>\n<p><#\n   .Synopsis\n    Convert a PowerShell transcript to a script.\n    .Description\n    This function will parse out all commands from a PowerShell transcript and create a PowerShell script file\n    that you can then continue to edit and flesh out. Existing script files will be overwritten unless you use\n    -NoClobber.\n    \n    IMPORTANT: This function assumes your PowerShell prompt starts with PS and ends with >.<br \/>\n    .Parameter Transcript<br \/>\n    The file name and path of your transcript file.<br \/>\n    .Parameter ScriptFile<br \/>\n    The filename and path for your new script. Existing files will be overwritten.<br \/>\n    .Parameter NoClobber<br \/>\n    Do not overwrite an existing script file. A warning will be displayed and the transcript<br \/>\n    will not be processed.<br \/>\n   .Example<br \/>\n    PS C:\\> Convert-TranscripttoScript \"c:\\work\\trans.txt\" \"c:\\scripts\\NewScript.ps1\"<br \/>\n    Finished parsing c:\\work\\trans.txt. See c:\\scripts\\NewScript.ps1 for your script.<\/p>\n<p>   .Notes<br \/>\n    NAME: Convert-TranscriptToScript<br \/>\n    AUTHOR: Jeffery Hicks<br \/>\n    VERSION: 1.0<br \/>\n    LASTEDIT: 03\/19\/2011<\/p>\n<p>    Learn more with a copy of Windows PowerShell 2.0: TFM (SAPIEN Press 2010)<\/p>\n<p>   .Link<br \/>\n    http:\/\/jdhitsolutions.com\/blog\/2011\/03\/convert-transcript-to-script\/<\/p>\n<p>    .Link<br \/>\n    Start-Transcript<br \/>\n    about_Regular_Expressions<\/p>\n<p>    .Inputs<br \/>\n    None<\/p>\n<p>    .Outputs<br \/>\n    None<br \/>\n#><\/p>\n<p>Param (<br \/>\n    [Parameter(Position=0,Mandatory=$True,HelpMessage=\"You need to specify a transcript file name and path.\")]<br \/>\n    [ValidateNotNullOrEmpty()]<br \/>\n    [ValidateScript({Test-Path $_})]<br \/>\n    [string]$Transcript,<br \/>\n    [Parameter(Position=1,Mandatory=$True,HelpMessage=\"You need to specify a filename for the new script.\")]<br \/>\n    [ValidateNotNullorEmpty()]<br \/>\n    [string]$ScriptFile,<br \/>\n    [Switch]$NoClobber<br \/>\n)<\/p>\n<p>#If -NoClobber make sure file doesn't already exist<br \/>\nif ($NoClobber -AND (Test-Path -Path $ScriptFile))<br \/>\n{<br \/>\n    Write-Warning \"NoClobber specified and $ScriptFile already exists. Try again with a new name.\"<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n    #Create new file and overwrite any existing file<br \/>\n    #This is a script header<br \/>\n    \"# Script Created $(Get-Date)\" | Out-File -filepath $ScriptFile<br \/>\n    \"# Source file: $Transcript\" |Out-File -filepath $ScriptFile -append<br \/>\n    \"# Author: $env:userdomain\\$env:username\" | Out-File -filepath $ScriptFile -append<br \/>\n    #insert a blank line<br \/>\n    write `n | Out-File -filepath $ScriptFile -append<\/p>\n<p>    #get all the lines that start with PS which should be part of a prompt.<br \/>\n    #and filter out the stop-transcript line<br \/>\n    #if you have a custom prompt that doesn't start with PS this probably won't work for you. Or<br \/>\n    #you will need to modify the regular expression<\/p>\n<p>    [regex]$r=\"^(?<path>PS(.+?)>)\"<br \/>\n    $filteredLog=Get-Content $Transcript | Select-String -pattern $r | where {$_ -notmatch \"stop-transcript\"}<\/p>\n<p>    $filteredLog | Foreach {<br \/>\n        #each object in $filteredLog is a MatchInfo object which needs to be converted to a string<br \/>\n        #Then split the string into an array using the regular expression<br \/>\n        $lines=$r.Split($_)<br \/>\n        #$_.ToString().split(\">\")<br \/>\n        #trim off spaces on the last element and write to the script file<br \/>\n        $lines[-1].Trim() | Out-File -filepath $ScriptFile -append<br \/>\n    }<br \/>\n    #add a closing comment<br \/>\n    write \"`n#End of script\" | Out-File -filepath $ScriptFile -append<\/p>\n<p>    Write-Host \"Finished parsing $Transcript. See $ScriptFile for your script.\" -ForegroundColor Green<br \/>\n    } #else<br \/>\n} #end function<br \/>\n[\/cc]<\/p>\n<p>The function makes an assumption that you aren't using a custom prompt as it uses a regular expression to match the default prompt in each line of text of the transcript.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n#get all the lines that start with PS which should be part of a prompt.<br \/>\n#and filter out the stop-transcript line<br \/>\n#if you have a custom prompt that doesn't start with PS this probably won't work for you. Or<br \/>\n#you will need to modify the regular expression<\/p>\n<p>[regex]$r=\"^(?<path>PS(.+?)>)\"<br \/>\n$filteredLog=Get-Content $Transcript | Select-String -pattern $r | where {$_ -notmatch \"stop-transcript\"}<br \/>\n[\/cc]<\/p>\n<p>My regular expression pattern is defined with a named group, path, but I don't really use it. Insted the function goes through each line of the filtered log and splits it on the matching pattern.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$filteredLog | Foreach {<br \/>\n       #each object in $filteredLog is a MatchInfo object which needs to be converted to a string<br \/>\n        #Then split the string into an array using the regular expression<br \/>\n        $lines=$r.Split($_)<br \/>\n        #trim off spaces on the last element and write to the script file<br \/>\n        $lines[-1].Trim() | Out-File -filepath $ScriptFile -append<br \/>\n    }<br \/>\n[\/cc]<br \/>\nIn my version I've created an alias, cts. Here's an example of taking a transcript and creating a script file.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> cts C:\\Users\\Jeff\\Documents\\PowerShell_transcript.20110321073839.txt -ScriptFile e:\\temp\\TestScript.ps1<br \/>\nFinished parsing C:\\Users\\Jeff\\Documents\\PowerShell_transcript.20110321073839.txt. See e:\\temp\\TestScript.ps1 for your script.<br \/>\n[\/cc]<\/p>\n<p>My function isn't especially fancy, although it does have a -NoClobber parameter so that it doesn't overwrite any existing files.  Personally, I prefer my Convert-HistoryToScript function since I don't always remember to start a transcript. But, Convert-TranscriptToScript if you get a transcript from somewhere like a class or colleague and would like to turn it into a script. In any event I hope you'll let me know how this works for you.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/Convert-TranscriptToScript.txt' target='_blank'>Convert-TranscriptToScript<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[134,4,42],"tags":[534,268,250,540,549,267],"class_list":["post-1242","post","type-post","status-publish","format-standard","hentry","category-conferences","category-powershell","category-techmentor","tag-powershell","tag-regex","tag-regular-expressions","tag-scripting","tag-techmentor","tag-transcript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Convert Transcript to Script &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert Transcript to Script &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"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&#039;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...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-21T15:22:53+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Convert Transcript to Script\",\"datePublished\":\"2011-03-21T15:22:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/\"},\"wordCount\":818,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"PowerShell\",\"regex\",\"Regular Expressions\",\"Scripting\",\"Techmentor\",\"transcript\"],\"articleSection\":[\"Conferences\",\"PowerShell\",\"Techmentor\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/\",\"name\":\"Convert Transcript to Script &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-03-21T15:22:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1242\\\/convert-transcript-to-script\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Conferences\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/conferences\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert Transcript to Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Convert Transcript to Script &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/","og_locale":"en_US","og_type":"article","og_title":"Convert Transcript to Script &#8226; The Lonely Administrator","og_description":"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...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-03-21T15:22:53+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Convert Transcript to Script","datePublished":"2011-03-21T15:22:53+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/"},"wordCount":818,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["PowerShell","regex","Regular Expressions","Scripting","Techmentor","transcript"],"articleSection":["Conferences","PowerShell","Techmentor"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/","name":"Convert Transcript to Script &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-03-21T15:22:53+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Conferences","item":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},{"@type":"ListItem","position":2,"name":"Convert Transcript to Script"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1597,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1597\/friday-fun-export-transcript-to-script\/","url_meta":{"origin":1242,"position":0},"title":"Friday Fun Export Transcript to Script","author":"Jeffery Hicks","date":"August 12, 2011","format":false,"excerpt":"Over the years I've posted variations on this technique and discuss it often in my training classes. The idea is to take your PowerShell transcript and transform it into a PowerShell script. Remember that there is very little difference between running commands in the shell and in a script. Thus,\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1247,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1247\/techmentor-orlando-2011-decks-and-demos\/","url_meta":{"origin":1242,"position":1},"title":"Techmentor Orlando 2011 Decks and Demos","author":"Jeffery Hicks","date":"March 21, 2011","format":false,"excerpt":"As promised, I have put together the most current versions of my slide decks and demos. A word of caution on the demos: many of them were designed to be used with my Start-Demo function, which essentially steps through the demo file one line at a time. The AD demos\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/TM_2011spring.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4445,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4445\/simulating-a-powershell-demo\/","url_meta":{"origin":1242,"position":2},"title":"Simulating a PowerShell Demo","author":"Jeffery Hicks","date":"July 13, 2015","format":false,"excerpt":"A number of years ago I published my version of a Start-Demo script. In my version, I can create a text file with all of the commands I want to run. It might look like this: Get-Date get-ciminstance win32_logicaldisk | select DeviceID,Size,Freespace :: get-service | where {$_.status -eq 'running'} |\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":147,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/147\/updated-domain-password-report\/","url_meta":{"origin":1242,"position":3},"title":"Updated Domain Password Report","author":"Jeffery Hicks","date":"September 12, 2008","format":false,"excerpt":"My September Mr. Roboto column covers a PowerShell script you can use to create a domain password report. I also demo'd the script at the NYC Techmentor conference this past week. Since then I realized a mistake in the way that I laid out the script. I had nested a\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1330,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1330\/powershell-ise-convert-all-aliases\/","url_meta":{"origin":1242,"position":4},"title":"PowerShell ISE Convert All Aliases","author":"Jeffery Hicks","date":"April 8, 2011","format":false,"excerpt":"Yesterday I posted an article on how to convert a selected word to an alias or cmdlet. While I think there is still some value in this piecemeal approach. sometimes you want to make wholesale changes, such as when troubleshooting a script that someone else wrote that is full of\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1340,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","url_meta":{"origin":1242,"position":5},"title":"Convert Aliases with the Tokenizer","author":"Jeffery Hicks","date":"April 12, 2011","format":false,"excerpt":"Last week I posted a function you can use in the Windows PowerShell ISE to convert aliases to command definitions. My script relied on regular expressions to seek out and replace aliases. A number of people asked me why I didn't use the PowerShell tokenizer. My answer was that because\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1242"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1242\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}