{"id":2976,"date":"2013-04-29T09:35:22","date_gmt":"2013-04-29T13:35:22","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2976"},"modified":"2013-04-29T09:35:22","modified_gmt":"2013-04-29T13:35:22","slug":"powershell-popup","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/","title":{"rendered":"PowerShell PopUp"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2977\" alt=\"popup\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.png\" width=\"300\" height=\"139\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup.png 371w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>At the recent PowerShell Summit I presented a session on adding graphical elements to your script without the need for WinForms or WPF. One of the items I demonstrated is a graphical popup that can either require the user to click a button or automatically dismiss after a set time period. If this sounds familiar, yes, it is our old friend VBScript and the Popup method of the Wscript.Shell object. Because PowerShell can create and use COM objects, why not take advantage of this?<\/p>\n<p>All it really takes is two lines. One line to create the Wscript.Shell COM object and one to invoke the Popup method.\u00a0\u00a0(Yes, I'm sure you could do this in one line, but that's not the point.)<\/p>\n<pre class=\"lang:default decode:true\">$wshell = New-Object -ComObject Wscript.Shell -ErrorAction Stop\r\n$wshell.Popup(\"Are you looking at me?\",0,\"Hey!\",48+4)<\/pre>\n<p>The Popup method needs parameters for the message, title, a timeout value, and an integer value that represents a combination of buttons and icons.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2978\" alt=\"popup2\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup2.png\" width=\"251\" height=\"172\" \/><\/a>The challenging part has always been trying to remember the integer values. So I wrote a quick function called New-Popup.<\/p>\n<pre class=\"lang:default decode:true\">#requires -version 2.0\r\n\r\nFunction New-Popup {\r\n\r\n&lt;#\r\n.Synopsis\r\nDisplay a Popup Message\r\n.Description\r\nThis command uses the Wscript.Shell PopUp method to display a graphical message\r\nbox. You can customize its appearance of icons and buttons. By default the user\r\nmust click a button to dismiss but you can set a timeout value in seconds to \r\nautomatically dismiss the popup. \r\n\r\nThe command will write the return value of the clicked button to the pipeline:\r\n  OK     = 1\r\n  Cancel = 2\r\n  Abort  = 3\r\n  Retry  = 4\r\n  Ignore = 5\r\n  Yes    = 6\r\n  No     = 7\r\n\r\nIf no button is clicked, the return value is -1.\r\n.Example\r\nPS C:\\&gt; new-popup -message \"The update script has completed\" -title \"Finished\" -time 5\r\n\r\nThis will display a popup message using the default OK button and default \r\nInformation icon. The popup will automatically dismiss after 5 seconds.\r\n.Notes\r\nLast Updated: April 8, 2013\r\nVersion     : 1.0\r\n\r\n.Inputs\r\nNone\r\n.Outputs\r\ninteger\r\n\r\nNull   = -1\r\nOK     = 1\r\nCancel = 2\r\nAbort  = 3\r\nRetry  = 4\r\nIgnore = 5\r\nYes    = 6\r\nNo     = 7\r\n#&gt;\r\n\r\nParam (\r\n[Parameter(Position=0,Mandatory=$True,HelpMessage=\"Enter a message for the popup\")]\r\n[ValidateNotNullorEmpty()]\r\n[string]$Message,\r\n[Parameter(Position=1,Mandatory=$True,HelpMessage=\"Enter a title for the popup\")]\r\n[ValidateNotNullorEmpty()]\r\n[string]$Title,\r\n[Parameter(Position=2,HelpMessage=\"How many seconds to display? Use 0 require a button click.\")]\r\n[ValidateScript({$_ -ge 0})]\r\n[int]$Time=0,\r\n[Parameter(Position=3,HelpMessage=\"Enter a button group\")]\r\n[ValidateNotNullorEmpty()]\r\n[ValidateSet(\"OK\",\"OKCancel\",\"AbortRetryIgnore\",\"YesNo\",\"YesNoCancel\",\"RetryCancel\")]\r\n[string]$Buttons=\"OK\",\r\n[Parameter(Position=4,HelpMessage=\"Enter an icon set\")]\r\n[ValidateNotNullorEmpty()]\r\n[ValidateSet(\"Stop\",\"Question\",\"Exclamation\",\"Information\" )]\r\n[string]$Icon=\"Information\"\r\n)\r\n\r\n#convert buttons to their integer equivalents\r\nSwitch ($Buttons) {\r\n    \"OK\"               {$ButtonValue = 0}\r\n    \"OKCancel\"         {$ButtonValue = 1}\r\n    \"AbortRetryIgnore\" {$ButtonValue = 2}\r\n    \"YesNo\"            {$ButtonValue = 4}\r\n    \"YesNoCancel\"      {$ButtonValue = 3}\r\n    \"RetryCancel\"      {$ButtonValue = 5}\r\n}\r\n\r\n#set an integer value for Icon type\r\nSwitch ($Icon) {\r\n    \"Stop\"        {$iconValue = 16}\r\n    \"Question\"    {$iconValue = 32}\r\n    \"Exclamation\" {$iconValue = 48}\r\n    \"Information\" {$iconValue = 64}\r\n}\r\n\r\n#create the COM Object\r\nTry {\r\n    $wshell = New-Object -ComObject Wscript.Shell -ErrorAction Stop\r\n    #Button and icon type values are added together to create an integer value\r\n    $wshell.Popup($Message,$Time,$Title,$ButtonValue+$iconValue)\r\n}\r\nCatch {\r\n    #You should never really run into an exception in normal usage\r\n    Write-Warning \"Failed to create Wscript.Shell COM object\"\r\n    Write-Warning $_.exception.message\r\n}\r\n\r\n} #end function<\/pre>\n<p>The function lets you use text descriptions for the buttons and icons. In PowerShell 3.0 you will also get tab completion for the possible values. This makes it easy to create a command like this:<\/p>\n<pre class=\"lang:default decode:true \">new-popup \"Do you want to get work done with PowerShell?\" -Title \"Hey, you!\" -Buttons YesNo -Icon Question<\/pre>\n<p>The function writes the value of the clicked button to the pipeline. I expect this is something you are more apt to use in a script. Perhaps to display an error message or even to prompt the user for an action. Maybe you'd like to use it in your PowerShell 3.0 profile:<\/p>\n<pre class=\"lang:default decode:true \">$r = New-Popup -Title \"Help Update\" -Message \"Do you want to update help now?\" -Buttons YesNo -Time 5 -Icon Question\r\nif ($r -eq 6) {\r\n  Update-Help -SourcePath \\\\jdh-nvnas\\files\\PowerShell_Help -Force\r\n}<\/pre>\n<p>The popup will automatically dismiss after 5 seconds unless I click Yes or No. You should be able to copy the function text from the listing above by toggling to plain code, select all and copy.<\/p>\n<p>I hope you'll let me know where you use this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the recent PowerShell Summit I presented a session on adding graphical elements to your script without the need for WinForms or WPF. One of the items I demonstrated is a graphical popup that can either require the user to click a button or automatically dismiss after a set time period. If this sounds familiar,&#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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[134,4,8],"tags":[423,534,424,540],"class_list":["post-2976","post","type-post","status-publish","format-standard","hentry","category-conferences","category-powershell","category-scripting","tag-com","tag-powershell","tag-pshsummit","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell PopUp &#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\/2976\/powershell-popup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell PopUp &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"At the recent PowerShell Summit I presented a session on adding graphical elements to your script without the need for WinForms or WPF. One of the items I demonstrated is a graphical popup that can either require the user to click a button or automatically dismiss after a set time period. If this sounds familiar,...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-29T13:35:22+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell PopUp\",\"datePublished\":\"2013-04-29T13:35:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/\"},\"wordCount\":303,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/04\\\/popup-300x139.png\",\"keywords\":[\"COM\",\"PowerShell\",\"PSHSummit\",\"Scripting\"],\"articleSection\":[\"Conferences\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/\",\"name\":\"PowerShell PopUp &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/04\\\/popup-300x139.png\",\"datePublished\":\"2013-04-29T13:35:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/04\\\/popup.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/04\\\/popup.png\",\"width\":371,\"height\":172},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2976\\\/powershell-popup\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Conferences\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/conferences\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell PopUp\"}]},{\"@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":"PowerShell PopUp &#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\/2976\/powershell-popup\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell PopUp &#8226; The Lonely Administrator","og_description":"At the recent PowerShell Summit I presented a session on adding graphical elements to your script without the need for WinForms or WPF. One of the items I demonstrated is a graphical popup that can either require the user to click a button or automatically dismiss after a set time period. If this sounds familiar,...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-04-29T13:35:22+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell PopUp","datePublished":"2013-04-29T13:35:22+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/"},"wordCount":303,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.png","keywords":["COM","PowerShell","PSHSummit","Scripting"],"articleSection":["Conferences","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/","name":"PowerShell PopUp &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.png","datePublished":"2013-04-29T13:35:22+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup.png","width":371,"height":172},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Conferences","item":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},{"@type":"ListItem","position":2,"name":"PowerShell PopUp"}]},{"@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":3939,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3939\/press-powershell-pause-to-continue\/","url_meta":{"origin":2976,"position":0},"title":"Press PowerShell Pause to Continue","author":"Jeffery Hicks","date":"August 8, 2014","format":false,"excerpt":"Everyone once in a while I come across a PowerShell script that behaves like an old-fashioned batch file. Not that there's anything wrong with that, but often these types of scripts put in a pause at the end of script so you can see that it finished. You might have\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"talkbubble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3004,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/","url_meta":{"origin":2976,"position":1},"title":"PowerShell Messagebox","author":"Jeffery Hicks","date":"May 8, 2013","format":false,"excerpt":"Recently I posted an article explaining how to create a popup box in PowerShell using the Wscript.Shell COM object from our VBScript days. That was something I presented at the PowerShell Summit. Another option is a MessageBox, again like we used to use in VBScript. This works very much like\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"messagebox","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1136,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1136\/friday-fun-snappy-shortcuts\/","url_meta":{"origin":2976,"position":2},"title":"Friday Fun &#8211; Snappy Shortcuts","author":"Jeffery Hicks","date":"February 11, 2011","format":false,"excerpt":"In one of my recent Prof. PowerShell columns, I wrote about using the Wscript.Shell VBScript object in PowerShell to retrieve special folder paths. Another handy trick is the ability to create shortcut links to either file or web resources. Let me show you how to accomplish this in PowerShell and\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\/02\/create-shortcuts-300x185.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4011,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4011\/friday-fun-a-popup-alternative\/","url_meta":{"origin":2976,"position":3},"title":"Friday Fun &#8211; A Popup Alternative","author":"Jeffery Hicks","date":"September 12, 2014","format":false,"excerpt":"In the past I've written and presented about different ways to add graphical elements to your PowerShell scripts that don't rely on Windows Forms or WPF. There's nothing wrong with those techniques, but they certainly require some expertise and depending on your situation may be overkill. So let's have some\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"windowpane-thumbnail","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/windowpane-thumbnail.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4293,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4293\/send-from-powershell-ise-to-microsoft-word-revisited\/","url_meta":{"origin":2976,"position":4},"title":"Send from PowerShell ISE to Microsoft Word Revisited","author":"Jeffery Hicks","date":"March 16, 2015","format":false,"excerpt":"Many of you seemed to like my little PowerShell ISE add-on to send text from the script pane to a Word document. I should have known someone would ask about a way to make it colorized. You can manually select lines in a script and when you paste them into\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":3661,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3661\/creating-cim-scripts-without-scripting\/","url_meta":{"origin":2976,"position":5},"title":"Creating CIM Scripts without Scripting","author":"Jeffery Hicks","date":"January 29, 2014","format":false,"excerpt":"When Windows 8 and Windows Server 2012 came out, along with PowerShell 3.0, we got our hands on some terrific technology in the form of the CIM cmdlets. Actually, we got much more than people realize. One of the reasons there was a big bump in the number of shipping\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\/2976","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=2976"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2976\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}