{"id":1938,"date":"2011-12-30T10:01:28","date_gmt":"2011-12-30T15:01:28","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1938"},"modified":"2011-12-30T10:01:28","modified_gmt":"2011-12-30T15:01:28","slug":"friday-fun-a-powershell-console-menu","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/","title":{"rendered":"Friday Fun &#8211; A PowerShell Console Menu"},"content":{"rendered":"<p>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 to give the person running the script a menu of choices. Here's one way you might accomplish this, without resorting to graphical tools or WinForms.<!--more--><\/p>\n<p>In PowerShell, we use the Read-Host cmdlet to get input from a user.<\/p>\n<p><code lang=\"Powershell><br \/>\nPS S:\\> $r=Read-Host \"Enter a name\"<br \/>\nEnter a name: Jeff<br \/>\nPS S:\\> $r<br \/>\nJeff<br \/>\nPS S:\\><br \/>\n<\/code><\/p>\n<p>The Read-Host prompt is a string, but it can be a complex string like this.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nPS S:\\> $menu=@\"<br \/>\n>> 1 Show info about a computer<br \/>\n>> 2 Show info about someones mailbox<br \/>\n>> 3 Restarts the print spooler<br \/>\n>> Q Quit<br \/>\n>><br \/>\n>> Select a task by number or Q to quit<br \/>\n>> \"@<br \/>\n>><br \/>\nPS S:\\> $r=Read-Host $menu<br \/>\n1 Show info about a computer<br \/>\n2 Show info about someones mailbox<br \/>\n3 Restarts the print spooler<br \/>\nQ Quit<br \/>\nSelect a task by number or Q to quit: 3<br \/>\nPS S:\\> $r<br \/>\n3<br \/>\n<\/code><\/p>\n<p>You could then use a Switch statement to do something based on the value of $r. For today's Friday Fun, I've wrapped all of this up in a demo script that includes a relatively simple menu building function.<\/p>\n<p><code lang=Powershell><\/p>\n<p>Function Show-Menu {<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,Mandatory=$True,HelpMessage=\"Enter your menu text\")]<br \/>\n[ValidateNotNullOrEmpty()]<br \/>\n[string]$Menu,<br \/>\n[Parameter(Position=1)]<br \/>\n[ValidateNotNullOrEmpty()]<br \/>\n[string]$Title=\"Menu\",<br \/>\n[switch]$ClearScreen<br \/>\n)<\/p>\n<p>if ($ClearScreen) {Clear-Host}<\/p>\n<p>#build the menu prompt<br \/>\n$menuPrompt=$title<br \/>\n#add a return<br \/>\n$menuprompt+=\"`n\"<br \/>\n#add an underline<br \/>\n$menuprompt+=\"-\"*$title.Length<br \/>\n$menuprompt+=\"`n\"<br \/>\n#add the menu<br \/>\n$menuPrompt+=$menu<\/p>\n<p>Read-Host -Prompt $menuprompt<\/p>\n<p>} #end function<\/p>\n<p>#define a menu here string<br \/>\n$menu=@\"<br \/>\n1 Show info about a computer<br \/>\n2 Show info about someones mailbox<br \/>\n3 Restarts the print spooler<br \/>\nQ Quit<\/p>\n<p>Select a task by number or Q to quit<br \/>\n\"@<\/p>\n<p>#Keep looping and running the menu until the user selects Q (or q).<br \/>\nDo {<br \/>\n    #use a Switch construct to take action depending on what menu choice<br \/>\n    #is selected.<br \/>\n    Switch (Show-Menu $menu \"My Help Desk Tasks\" -clear) {<br \/>\n     \"1\" {Write-Host \"run get info code\" -ForegroundColor Yellow<br \/>\n         sleep -seconds 2<br \/>\n         }<br \/>\n     \"2\" {Write-Host \"run show mailbox code\" -ForegroundColor Green<br \/>\n          sleep -seconds 5<br \/>\n          }<br \/>\n     \"3\" {Write-Host \"restart spooler\" -ForegroundColor Magenta<br \/>\n         sleep -seconds 2<br \/>\n         }<br \/>\n     \"Q\" {Write-Host \"Goodbye\" -ForegroundColor Cyan<br \/>\n         Return<br \/>\n         }<br \/>\n     Default {Write-Warning \"Invalid Choice. Try again.\"<br \/>\n              sleep -milliseconds 750}<br \/>\n    } #switch<br \/>\n} While ($True)<br \/>\n<\/code><\/p>\n<p>The Show-Menu function takes parameters for the menu body, a title and switch indicating if you want to clear the screen before displaying the menu. Within the function, I create a new string to use as the prompt for Read-Host. I've split it up into distinct steps so you can better understand what I'm doing.  The main part of the script is the Do loop which uses a Switch construct to run the Show-Menu function.<\/p>\n<p><code lang=PowerShell><br \/>\n    Switch (Show-Menu $menu \"My Help Desk Tasks\" -clear) {<br \/>\n<\/code><\/p>\n<p>The script will keep running until the user presses Q (or q).  Here's what you would see.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.png\" alt=\"\" title=\"console-menu\" width=\"300\" height=\"187\" class=\"aligncenter size-medium wp-image-1939\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu.png 709w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The essence of this technique is to create a multi-line prompt with a here string and then a Switch statement based on the Read-Host input. Just don't forget to validate the input. Or you can use my Show-Menu function.<\/p>\n<p>Download my <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Demo-ConsoleMenu.txt' target='_blank'>Demo-ConsoleMenu<\/a> script and enjoy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 to give the person running&#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":[271,75,8],"tags":[176,534,272,189],"class_list":["post-1938","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell-v2-0","category-scripting","tag-console","tag-powershell","tag-read-host","tag-switch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun - A PowerShell Console Menu &#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\/1938\/friday-fun-a-powershell-console-menu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun - A PowerShell Console Menu &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"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 to give the person running...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-30T15:01:28+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun &#8211; A PowerShell Console Menu\",\"datePublished\":\"2011-12-30T15:01:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/\"},\"wordCount\":292,\"commentCount\":11,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/console-menu-300x187.png\",\"keywords\":[\"console\",\"PowerShell\",\"Read-Host\",\"switch\"],\"articleSection\":[\"Friday Fun\",\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/\",\"name\":\"Friday Fun - A PowerShell Console Menu &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/console-menu-300x187.png\",\"datePublished\":\"2011-12-30T15:01:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/console-menu.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/console-menu.png\",\"width\":\"709\",\"height\":\"443\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1938\\\/friday-fun-a-powershell-console-menu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun &#8211; A PowerShell Console Menu\"}]},{\"@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":"Friday Fun - A PowerShell Console Menu &#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\/1938\/friday-fun-a-powershell-console-menu\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun - A PowerShell Console Menu &#8226; The Lonely Administrator","og_description":"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 to give the person running...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-12-30T15:01:28+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun &#8211; A PowerShell Console Menu","datePublished":"2011-12-30T15:01:28+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/"},"wordCount":292,"commentCount":11,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.png","keywords":["console","PowerShell","Read-Host","switch"],"articleSection":["Friday Fun","PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/","name":"Friday Fun - A PowerShell Console Menu &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.png","datePublished":"2011-12-30T15:01:28+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu.png","width":"709","height":"443"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun &#8211; A PowerShell Console Menu"}]},{"@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":1404,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","url_meta":{"origin":1938,"position":0},"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":[]},{"id":4184,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4184\/friday-fun-search-me\/","url_meta":{"origin":1938,"position":1},"title":"Friday Fun: Search Me","author":"Jeffery Hicks","date":"January 16, 2015","format":false,"excerpt":"I've been working on a few revisions and additions to my ISE Scripting Geek module. Even though what I'm about to show you will eventually be available in a future release of that module, I thought I'd share it with you today. One of the things I wanted to be\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"magnifying-glass-text-label-search","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/magnifying-glass-text-label-search-150x150.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3455,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3455\/friday-fun-color-my-web\/","url_meta":{"origin":1938,"position":2},"title":"Friday Fun Color My Web","author":"Jeffery Hicks","date":"September 20, 2013","format":false,"excerpt":"Awhile ago I posted an article demonstrating using Invoke-Webrequest which is part of PowerShell 3.0. I used the page at Manning.com to display the Print and MEAP bestsellers. By the way, thanks to all of you who keep making PowerShell books popular. My original script simply wrote the results to\u2026","rel":"","context":"In &quot;Books&quot;","block_context":{"text":"Books","link":"https:\/\/jdhitsolutions.com\/blog\/category\/books\/"},"img":{"alt_text":"get-manningbestseller1","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/get-manningbestseller1-1024x606.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/get-manningbestseller1-1024x606.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/get-manningbestseller1-1024x606.png?resize=525%2C300 1.5x"},"classes":[]},{"id":904,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/","url_meta":{"origin":1938,"position":3},"title":"Friday Fun: Color My World","author":"Jeffery Hicks","date":"September 3, 2010","format":false,"excerpt":"The end of another work week and time for a little PowerShell fun. When I first started using PowerShell, I was fascinated by Write-Host and the ability to write colorized text to the console. Visions of ANSI art danced in my head, but I've moved on. Using colors with Write-Host\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\/2010\/09\/color-1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png?resize=525%2C300 1.5x"},"classes":[]},{"id":4923,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/4923\/friday-fun-tweaking-the-powershell-ise\/","url_meta":{"origin":1938,"position":4},"title":"Friday Fun: Tweaking the PowerShell ISE","author":"Jeffery Hicks","date":"February 19, 2016","format":false,"excerpt":"Today's fun is still PowerShell related, but instead of something in the console, we'll have some fun with the PowerShell ISE. One of the things I love about the PowerShell ISE is that you can customize it and extend it.\u00a0 My ISE Scripting Geek project is an example.\u00a0 But today\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-12.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":558,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/558\/promoting-scripting-and-powershell\/","url_meta":{"origin":1938,"position":5},"title":"Promoting Scripting and PowerShell","author":"Jeffery Hicks","date":"January 21, 2010","format":false,"excerpt":"Last week I was interviewed on the Mind of Root podcast about what administrators can do to promote PowerShell and automation in their environments. The show is now available for streaming or download. I still think your best approach is to gently let everyone know that it's not a matter\u2026","rel":"","context":"In &quot;Exchange&quot;","block_context":{"text":"Exchange","link":"https:\/\/jdhitsolutions.com\/blog\/category\/exchange\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1938","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=1938"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1938\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}