{"id":1404,"date":"2011-05-03T10:04:16","date_gmt":"2011-05-03T14:04:16","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1404"},"modified":"2011-05-27T09:31:29","modified_gmt":"2011-05-27T13:31:29","slug":"start-typeddemo","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","title":{"rendered":"Start-TypedDemo"},"content":{"rendered":"<p>As you know, I do a lot of presenting and training. Normally I use the ubiquitous Start-Demo function to run through a demo list of commands. Most of this time this works just fine. But when I'm doing videos, especially for a video project, I want the viewer to focus on the command and not the fact that I'm running a script to execute those commands. What I want is a way to run through a demo script but make it look like I'm typing. Thus was born Start-TypedDemo.<!--more--><\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Start-TypedDemo {<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,Mandatory=$True,HelpMessage=\"Enter the name of a text file with your demo commands\")]<br \/>\n[ValidateScript({Test-Path $_})]<br \/>\n[string]$File,<br \/>\n[ValidateScript({$_ -gt 0})]<br \/>\n[int]$Pause=100,<br \/>\n[switch]$NoExecute<br \/>\n)<\/p>\n<p>#this is an internal function so I'm not worried about the name<br \/>\nFunction PauseIt {<\/p>\n<p>Param()<br \/>\n    #wait for a key press<br \/>\n    $Running=$true<br \/>\n    #keep looping until a key is pressed<br \/>\n    While ($Running)<br \/>\n    {<br \/>\n     if ($host.ui.RawUi.KeyAvailable) {<br \/>\n     $key = $host.ui.RawUI.ReadKey(\"NoEcho,IncludeKeyDown\")<br \/>\n        if ($key) {<br \/>\n         $Running=$False<br \/>\n         #check the value and if it is q or ESC, then bail out<br \/>\n         if ($key -match \"q|27\") {<br \/>\n           Write-Host `r<br \/>\n           Return \"quit\"<br \/>\n           }<br \/>\n        }<br \/>\n      }<br \/>\n      start-sleep -millisecond 100<br \/>\n    } #end While<br \/>\n} #PauseIt function<\/p>\n<p>#abort if running in the ISE<br \/>\nif ($host.name -match \"PowerShell ISE\") {<br \/>\n    Write-Warning \"This will not work in the ISE. Use the PowerShell console host.\"<br \/>\n    Return<br \/>\n}<\/p>\n<p>Clear-Host<\/p>\n<p>#strip out all comments<br \/>\n$commands=Get-Content -Path $file | Where {-NOT $_.StartsWith(\"#\")}<br \/>\n$count=0<\/p>\n<p>#write a prompt using your current prompt function<br \/>\nWrite-Host $(prompt) -NoNewline<\/p>\n<p>foreach ($command in $commands) {<br \/>\n   $count++<br \/>\n   #pause until a key is pressed which will then process the next command<br \/>\n   $p=PauseIt<br \/>\n   If ($p -eq \"quit\") {Return}<\/p>\n<p>    for ($i=0;$i -lt $command.length;$i++) {<br \/>\n     write-host $command[$i] -NoNewline<br \/>\n     Start-sleep -Milliseconds $Pause<br \/>\n     #if character is a pipe ( | ) pause in case an<br \/>\n     #explanation is needed<br \/>\n     if ($command[$i] -eq \"|\") {<br \/>\n        $p=PauseIt<br \/>\n        If ($p -eq \"quit\") {Return}<br \/>\n     }<br \/>\n    }<\/p>\n<p>    #Pause until ready to run the command<br \/>\n    $p=PauseIt<br \/>\n    If ($p -eq \"quit\") {Return}<br \/>\n    Write-host `n<br \/>\n    #execute the command unless -NoExecute was specified<br \/>\n    if (-NOT $NoExecute) {<br \/>\n        Invoke-Expression $command | Out-Default<br \/>\n    }<\/p>\n<p>   #reset the prompt unless we've just done the last command<br \/>\n   if ($count -lt $commands.count) {<br \/>\n    Write-Host $(prompt) -NoNewline<br \/>\n   }<\/p>\n<p>  } #foreach<br \/>\n} #function<br \/>\n[\/cc]<\/p>\n<p>Conceptually, this function is pretty simple: take a line of text, turn it into a character array and write each character to the console with a slight pause. <\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nfor ($i=0;$i -lt $command.length;$i++) {<br \/>\n     write-host $command[$i] -NoNewline<br \/>\n     Start-sleep -Milliseconds $Pause<br \/>\n[\/cc]<\/p>\n<p>The default pause interval is 100 but you can use -Pause to specify a value in milliseconds. This produces the illusion of someone typing a command, but with no mistakes. After the command is typed it is executed. <\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n #execute the command unless -NoExecute was specified<br \/>\n    if (-NOT $NoExecute) {<br \/>\n        Invoke-Expression $command | Out-Default<br \/>\n    }<br \/>\n[\/cc]<\/p>\n<p>If you want to run through your demo but without running the commands, use the -NoExecute parameter.<\/p>\n<p>One limitation to this version of the script is that your command must be a one-line expression. I have an idea on how to handle multiple lines but haven't had time to develop them yet. But since most of the time demos are relatively simple I'm trusting this won't be much of an obstacle. The function will also ignore any commented lines. But it will maintain your prompt so when you change locations the fact that you are running a function remains hidden.<\/p>\n<p>The function will pause after typing the line until you press any key. It will also pause after a | character in case you want to explain what you are doing. You can press 'q' or ESC at any pause to abort the demo.  Because of this, the function will not work in the ISE.<\/p>\n<p>Here's a short video of the function in action.<\/p>\n<p><object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/lIThpVQOcZM?hl=en&fs=1\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><param name=\"allowscriptaccess\" value=\"always\"><\/param><\/object><\/p>\n<p>I have a few other thoughts for improvements but I'd love to hear how this works for you. Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/05\/Start-TypedDemo.txt' target='_blank'>Start-TypedDemo<\/a>.<\/p>\n<p><strong>UPDATE<\/strong>: Version 2 of this script with many new features can be found at <a href=\"http:\/\/jdhitsolutions.com\/blog\/2011\/05\/friday-fun-start-typeddemo-v2\/\">http:\/\/jdhitsolutions.com\/blog\/2011\/05\/friday-fun-start-typeddemo-v2\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As you know, I do a lot of presenting and training. Normally I use the ubiquitous Start-Demo function to run through a demo list of commands. Most of this time this works just fine. But when I&#8217;m doing videos, especially for a video project, I want the viewer to focus on the command and not&#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":[75,8,9],"tags":[265,224,534,101],"class_list":["post-1404","post","type-post","status-publish","format-standard","hentry","category-powershell-v2-0","category-scripting","category-training","tag-demo","tag-function","tag-powershell","tag-write-host"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Start-TypedDemo &#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\/scripting\/1404\/start-typeddemo\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Start-TypedDemo &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"As you know, I do a lot of presenting and training. Normally I use the ubiquitous Start-Demo function to run through a demo list of commands. Most of this time this works just fine. But when I&#039;m doing videos, especially for a video project, I want the viewer to focus on the command and not...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-05-03T14:04:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-05-27T13:31:29+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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Start-TypedDemo\",\"datePublished\":\"2011-05-03T14:04:16+00:00\",\"dateModified\":\"2011-05-27T13:31:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/\"},\"wordCount\":669,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Demo\",\"Function\",\"PowerShell\",\"Write-Host\"],\"articleSection\":[\"PowerShell v2.0\",\"Scripting\",\"Training\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/\",\"name\":\"Start-TypedDemo &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-05-03T14:04:16+00:00\",\"dateModified\":\"2011-05-27T13:31:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1404\\\/start-typeddemo\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell v2.0\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-v2-0\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Start-TypedDemo\"}]},{\"@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":"Start-TypedDemo &#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\/scripting\/1404\/start-typeddemo\/","og_locale":"en_US","og_type":"article","og_title":"Start-TypedDemo &#8226; The Lonely Administrator","og_description":"As you know, I do a lot of presenting and training. Normally I use the ubiquitous Start-Demo function to run through a demo list of commands. Most of this time this works just fine. But when I'm doing videos, especially for a video project, I want the viewer to focus on the command and not...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-05-03T14:04:16+00:00","article_modified_time":"2011-05-27T13:31:29+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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Start-TypedDemo","datePublished":"2011-05-03T14:04:16+00:00","dateModified":"2011-05-27T13:31:29+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/"},"wordCount":669,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Demo","Function","PowerShell","Write-Host"],"articleSection":["PowerShell v2.0","Scripting","Training"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","name":"Start-TypedDemo &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-05-03T14:04:16+00:00","dateModified":"2011-05-27T13:31:29+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell v2.0","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},{"@type":"ListItem","position":2,"name":"Start-TypedDemo"}]},{"@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":4445,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4445\/simulating-a-powershell-demo\/","url_meta":{"origin":1404,"position":0},"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":1061,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1061\/we-pause-a-moment\/","url_meta":{"origin":1404,"position":1},"title":"We Pause a Moment","author":"Jeffery Hicks","date":"January 17, 2011","format":false,"excerpt":"Most of the time when running a PowerShell script or series of commands you want to blast your way through. But there might be times where you want to pause script execution. Perhaps to display an informational message or to simply pace execution. In my work as a trainer and\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/pause-example-1024x517.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/pause-example-1024x517.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/pause-example-1024x517.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1473,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1473\/friday-fun-start-typeddemo-v2\/","url_meta":{"origin":1404,"position":2},"title":"Friday Fun: Start-TypedDemo v2","author":"Jeffery Hicks","date":"May 27, 2011","format":false,"excerpt":"Not too long ago I posted a function I wrote for doing PowerShell demonstrations. My goal was to simulate a live interactive demo but without the typing so I could focus on explaining and not typing. The first version was a good start but I always had plans for a\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":1220,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1220\/friday-fun-virtual-demos\/","url_meta":{"origin":1404,"position":3},"title":"Friday Fun Virtual Demos","author":"Jeffery Hicks","date":"March 11, 2011","format":false,"excerpt":"I've been prepping my demo scripts for Techmentor using the ubiquitous Start-Demo, and realized I could take things further. I mean, why do I have to do all the talking? Windows 7 has a terrific text to speech engine so why not take advantage of it. With a little work\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8709,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8709\/converting-powershell-scripts-to-functions\/","url_meta":{"origin":1404,"position":4},"title":"Converting PowerShell Scripts to Functions","author":"Jeffery Hicks","date":"December 10, 2021","format":false,"excerpt":"Recently, I shared some PowerShell code to export a function to a file. It was a popular post. My friend Richard Hicks (no relation) thought we was joking when he asked about converting files to functions. His thought was to take a bunch of PowerShell scripts, turn them into a\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/poc-modulecommands.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/poc-modulecommands.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/poc-modulecommands.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/poc-modulecommands.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2193,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2193\/powershell-scripting-with-validatescript\/","url_meta":{"origin":1404,"position":5},"title":"PowerShell Scripting with [ValidateScript]","author":"Jeffery Hicks","date":"April 12, 2012","format":false,"excerpt":"The last few days we've been looking at parameter validation attributes you might use in a script of function. Yesterday I wrote about [ValidateRange] and demonstrated how you might use it. That attribute works fine for any values that can be evaluated as numbers. But dates are a different story.\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1404","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=1404"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1404\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}