{"id":3954,"date":"2014-08-18T12:13:38","date_gmt":"2014-08-18T16:13:38","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3954"},"modified":"2014-08-18T12:13:38","modified_gmt":"2014-08-18T16:13:38","slug":"more-flashing-fun","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/","title":{"rendered":"More Flashing Fun"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1688\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png\" alt=\"talkbubble\" width=\"198\" height=\"208\" \/><\/a>I received a lot of interest in my <a title=\"Look at Me!\" href=\"http:\/\/jdhitsolutions.com\/blog\/2014\/08\/look-at-me\/\" target=\"_blank\">Invoke-Flasher script<\/a>. One comment I received on Twitter was for a way to use it interactively in a script. In essence, he wanted a flashing Read-Host so I took my original concept and tweaked it until I came up with a Read-Host alternative I simply call Read-Host2. This function will only work in the PowerShell console, NOT the PowerShell ISE.<\/p>\n<pre class=\"lang:ps decode:true \">#requires -version 3.0\r\n\r\nFunction Read-Host2 {\r\n\r\n&lt;#\r\n.Synopsis\r\nAn alternative to Read-Host\r\n.Description\r\nThis is an alternative to Read-Host which works almost the same as the original cmdlet. You can use this to prompt the user for input. They can either enter text or have the text converted to a secure string. The only difference is that the prompt will display in a flashing colors until you start typing.\r\n\r\nThis command will NOT work properly in the PowerShell ISE.\r\n.Parameter Prompt\r\nThe text to be displayed. A colon will be appended.\r\n.Parameter AsSecureString\r\nThe entered text will be treated as a secure string. This parameter has an alias of 'ss'.\r\n.Parameter UseForeground\r\nFlash the text color instead of the background. This parameter has aliases of 'fg' and 'foreground'.\r\n.Example\r\nPS C:\\&gt; $user = Read-Host2 \"Enter a username\" -color DarkGreen\r\n\r\nPrompt for user name using a dark green background\r\n.Example\r\nPS C:\\&gt; $pass = Read-Host2 \"Enter a password\" -color darkred -foreground -asSecureString\r\nPrompt for a password using DarkRed as the foreground color.\r\n.Example\r\nPS C:\\&gt; $s={ $l = get-eventlog -list ; Read-host2 \"Press enter to continue\" ; $l}\r\nPS C:\\&gt; &amp;$s\r\nPress enter to continue :\r\n\r\n\r\n  Max(K) Retain OverflowAction        Entries Log\r\n  ------ ------ --------------        ------- ---\r\n  20,480      0 OverwriteAsNeeded      30,829 Application\r\n  20,480      0 OverwriteAsNeeded           0 HardwareEvents\r\n     512      7 OverwriteOlder              0 Internet Explorer\r\n  20,480      0 OverwriteAsNeeded           0 Key Management Service\r\n  20,480      0 OverwriteAsNeeded          12 Lenovo-Customer Feedback\r\n     128      0 OverwriteAsNeeded         455 OAlerts\r\n     512      7 OverwriteOlder              0 PreEmptive\r\n  20,480      0 OverwriteAsNeeded      32,013 Security\r\n  20,480      0 OverwriteAsNeeded      26,475 System\r\n  15,360      0 OverwriteAsNeeded      17,715 Windows PowerShell\r\n\r\n This is an example of how you might use the command in a script. The prompt will keep flashing until you press Enter.\r\n.Notes\r\nLast Updated: August 18, 2014\r\nVersion     : 0.9\r\nLearn more:\r\n PowerShell in Depth: An Administrator's Guide (http:\/\/www.manning.com\/jones2\/)\r\n PowerShell Deep Dives (http:\/\/manning.com\/hicks\/)\r\n Learn PowerShell in a Month of Lunches (http:\/\/manning.com\/jones3\/)\r\n Learn PowerShell Toolmaking in a Month of Lunches (http:\/\/manning.com\/jones4\/)\r\n\r\n  ****************************************************************\r\n  * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED *\r\n  * THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK.  IF   *\r\n  * YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, *\r\n  * DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.             *\r\n  ****************************************************************\r\n\r\n.Link\r\nhttp:\/\/jdhitsolutions.com\/blog\/2014\/08\/more-flashing-fun\r\n\r\n.Link\r\nRead-Host\r\nConvertTo-SecureString\r\n#&gt;\r\n\r\n[cmdletbinding()]\r\nParam(\r\n[Parameter(Position=0,Mandatory,HelpMessage=\"Enter a prompt message without a colon (:)\")]\r\n[string]$Prompt,\r\n[Alias('ss')]\r\n[switch]$AsSecureString,\r\n[System.ConsoleColor]$Color = \"Red\",\r\n[Alias(\"fg\",\"Foreground\")]\r\n[switch]$UseForeground\r\n)\r\n\r\n#this will be the array of entered characters\r\n$text = @()\r\n\r\n#save current background and foreground colors\r\n$bg = $host.ui.RawUI.BackgroundColor\r\n$fg = $host.ui.RawUI.ForegroundColor\r\n\r\n#set a variable to be used in a While loop \r\n$Running = $True\r\n\r\n#set a variable to determine if the user is typing something\r\n$Typing = $False\r\n\r\n#get current cursor position\r\n$Coordinate = $host.ui.RawUI.CursorPosition\r\n\r\n$msg = \"`r$Prompt : \"\r\n\r\nWhile ($Running) {\r\n\r\n if (-Not $Typing) {\r\n    #don't toggle or pause if the user is typing\r\n    if ($UseForeground) {\r\n        if ($host.ui.RawUI.ForegroundColor -eq $fg) {\r\n            $host.ui.RawUI.ForegroundColor = $color\r\n\r\n        }\r\n        else {\r\n            $host.ui.RawUI.ForegroundColor = $fg\r\n        }\r\n    }\r\n    else {\r\n        if ($host.ui.RawUI.BackgroundColor -eq $bg) {\r\n            $host.ui.RawUI.BackgroundColor = $color\r\n\r\n        }\r\n        else {\r\n            $host.ui.RawUI.BackgroundColor = $bg\r\n        }\r\n    }\r\n      Start-Sleep -Milliseconds 350\r\n    } #if not typing\r\n\r\n    #set the cursor position\r\n    $host.ui.rawui.CursorPosition=$Coordinate\r\n\r\n    #write the message on a new line\r\n    \r\n    Write-Host $msg\r\n  \r\n    #see if a key has been pushed\r\n    if ($host.ui.RawUi.KeyAvailable) {\r\n        #user is typing\r\n        $Typing = $True\r\n        \r\n        #filter out shift key \r\n        $key = $host.ui.RawUI.ReadKey(\"NoEcho,IncludeKeyDown\") \r\n        \r\n        Switch ($key.virtualKeyCode) {\r\n        \r\n            13 { $Running = $False ; Break}\r\n            16 { #Shift key so don't do anything\r\n                 Break\r\n               }\r\n            Default{\r\n                #add the key to the array\r\n                $text+=$key\r\n\r\n                #display the entered text\r\n                if ($AsSecureString) {\r\n                  #mask the character if asking for a secure string\r\n                  $out = \"*\"\r\n                }\r\n                else {\r\n                  $out = $key.character\r\n                }\r\n                #append the character to the prompt\r\n                $msg+= $out\r\n            }\r\n      } #switch\r\n  \r\n    } #if key available\r\n    \r\n} #while\r\n\r\n#reset the original background color\r\n$host.ui.RawUI.BackgroundColor = $bg\r\n$host.ui.RawUI.ForegroundColor = $fg\r\n\r\n#write the input to the pipeline\r\n#removing any leading or trailing spaces\r\n$data = (-join $text.Character).Trim()\r\n\r\n#convert to SecureString if specified\r\nif ($AsSecureString) {\r\n ConvertTo-SecureString -String $data -AsPlainText -Force\r\n}\r\nelse {\r\n    #write the read data to the pipeline\r\n    $data\r\n}\r\n \r\n} #end function\r\n<\/pre>\n<p>The main tweak I made was to collect all the typed keys until Enter is pressed. I have a Switch construct to also eliminate the Shift key. The assumption is that you are writing text so this should be the only non alphanumeric key you would use. The message prompt will keep flashing until you start typing. I also emulated echoing text to the screen, including password masking if you use AsSecureString. The last change is a new parameter to allow you to flash the foreground color instead of the background color. There are several examples in the comment-based help.<\/p>\n<p>Here are some screen shots.<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-01-300x95.png\" alt=\"Read-Host2-01\" width=\"300\" height=\"95\" class=\"aligncenter size-medium wp-image-3956\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-01-300x95.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-01.png 1009w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-02-300x102.png\" alt=\"Read-Host2-02\" width=\"300\" height=\"102\" class=\"aligncenter size-medium wp-image-3957\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-02-300x102.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-02-1024x348.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/Read-Host2-02.png 1477w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I hope you'll let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I received a lot of interest in my Invoke-Flasher script. One comment I received on Twitter was for a way to use it interactively in a script. In essence, he wanted a flashing Read-Host so I took my original concept and tweaked it until I came up with a Read-Host alternative I simply call Read-Host2&#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":"More Flashing Fun with #PowerShell http:\/\/wp.me\/p1nF6U-11M","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[534,272,540],"class_list":["post-3954","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-powershell","tag-read-host","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>More Flashing Fun &#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\/3954\/more-flashing-fun\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More Flashing Fun &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I received a lot of interest in my Invoke-Flasher script. One comment I received on Twitter was for a way to use it interactively in a script. In essence, he wanted a flashing Read-Host so I took my original concept and tweaked it until I came up with a Read-Host alternative I simply call Read-Host2....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-08-18T16:13:38+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png\" \/>\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\\\/3954\\\/more-flashing-fun\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"More Flashing Fun\",\"datePublished\":\"2014-08-18T16:13:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/\"},\"wordCount\":186,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\",\"keywords\":[\"PowerShell\",\"Read-Host\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/\",\"name\":\"More Flashing Fun &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\",\"datePublished\":\"2014-08-18T16:13:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/talkbubble.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3954\\\/more-flashing-fun\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"More Flashing Fun\"}]},{\"@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":"More Flashing Fun &#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\/3954\/more-flashing-fun\/","og_locale":"en_US","og_type":"article","og_title":"More Flashing Fun &#8226; The Lonely Administrator","og_description":"I received a lot of interest in my Invoke-Flasher script. One comment I received on Twitter was for a way to use it interactively in a script. In essence, he wanted a flashing Read-Host so I took my original concept and tweaked it until I came up with a Read-Host alternative I simply call Read-Host2....","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-08-18T16:13:38+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","type":"","width":"","height":""}],"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\/3954\/more-flashing-fun\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"More Flashing Fun","datePublished":"2014-08-18T16:13:38+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/"},"wordCount":186,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","keywords":["PowerShell","Read-Host","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/","name":"More Flashing Fun &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","datePublished":"2014-08-18T16:13:38+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3954\/more-flashing-fun\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"More Flashing Fun"}]},{"@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":3948,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3948\/look-at-me\/","url_meta":{"origin":3954,"position":0},"title":"Look at Me!","author":"Jeffery Hicks","date":"August 12, 2014","format":false,"excerpt":"Last week I posted some ideas on how to add notifications to your scripts. Those ideas were variations on the old school \"Press any key to continue\" prompt that I assume many of you are familiar with. Most of those concepts should work for you, but they assume you looking\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"bluelight","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/08\/bluelight-214x300.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1061,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1061\/we-pause-a-moment\/","url_meta":{"origin":3954,"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":4070,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4070\/powershell-dates-times-and-formats\/","url_meta":{"origin":3954,"position":2},"title":"PowerShell Dates, Times and Formats","author":"Jeffery Hicks","date":"October 8, 2014","format":false,"excerpt":"If you are like me you use date time values constantly in PowerShell. From simply displaying the current date and time in progress message to using different values to create file or folder names. The Get-Date cmdlet has a -Format parameter which you can use. The tricky part is remembering\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"astroclock_thumb","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/10\/astroclock_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1938,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/","url_meta":{"origin":3954,"position":3},"title":"Friday Fun &#8211; A PowerShell Console Menu","author":"Jeffery Hicks","date":"December 30, 2011","format":false,"excerpt":"When working in PowerShell, and especially when scripting, you might want to give the user a choice of actions. For example, you might develop a configuration script that another admin or technician will run. Perhaps one of the steps is to configure networking depending on their location so you want\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":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1220,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1220\/friday-fun-virtual-demos\/","url_meta":{"origin":3954,"position":4},"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":1404,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","url_meta":{"origin":3954,"position":5},"title":"Start-TypedDemo","author":"Jeffery Hicks","date":"May 3, 2011","format":false,"excerpt":"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\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3954","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=3954"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3954\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}