{"id":3004,"date":"2013-05-08T08:27:01","date_gmt":"2013-05-08T12:27:01","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3004"},"modified":"2013-05-08T08:27:01","modified_gmt":"2013-05-08T12:27:01","slug":"powershell-messagebox","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/","title":{"rendered":"PowerShell Messagebox"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-3005\" alt=\"messagebox\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.png\" width=\"300\" height=\"147\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox.png 349w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Recently I posted an article explaining <a title=\"read the previous article\" href=\"http:\/\/jdhitsolutions.com\/blog\/2013\/04\/powershell-popup\/\" target=\"_blank\">how to create a popup box in PowerShell<\/a> 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 the popup except the user has to click a button to dismiss the box. I can't think of a compelling reason why you would choose one technique over the other if you need the user to click something. But I'll let you make that call. Here's the function, New-Messagebox.<\/p>\n<pre class=\"lang:default decode:true\">#requires -version 2.0\r\n\r\nFunction New-Messagebox {\r\n\r\n&lt;#\r\n.Synopsis\r\nDisplay a VisualBasic style message box.\r\n.Description\r\nThis function will display a graphical messagebox, like the one from VisualBasic\r\nand VBScript. You must specify a message. The default button is OKOnly and the \r\ndefault icon is for Information. If you want to use the value from a button click\r\nin a PowerShell expression, use the -Passthru parameter.\r\n\r\nThe message box will remain displayed until the user clicks a button. The box may \r\nalso not appear on top, but if you have audio enabled you should hear the Windows \r\nexclamation sound.\r\n.Parameter Message\r\nThe text to display. Keep it short.\r\n.Parameter Button\r\nThe button set to display. The default is OKOnly. Possible values are:\r\n    OkOnly\r\n    OkCancel\r\n    AbortRetryIgnore\r\n    YesNoCancel\r\n    YesNo\r\n    RetryCancel\r\n.Parameter Icon\r\nThe icon to display. The default is Information. Possible values are:\r\n    Critical\r\n    Question\r\n    Exclamation\r\n    Information\r\n.Parameter Title\r\nThe message box title. The default is no title. The title should be less than \r\n24 characters long, otherwise it will be truncated.\r\n.Parameter NoPassthru\r\nUse this parameter if you DO NOT want the button value to be passed to the pipeline.\r\n.Example\r\nPS C:\\&gt; New-Messagebox \"Time to go home!\"\r\nDisplay a message box with no title and the OK button.\r\n.Example\r\nPS C:\\&gt; $rc=New-Messagebox -message \"Do you know what you're doing?\" -icon exclamation -button \"YesNoCancel\" -title \"Hey $env:username!!\" \r\nSwitch ($rc) {\r\n \"Yes\" {\"I hope your resume is up to date.\"}\r\n \"No\" {\"Wise move.\"}\r\n \"Cancel\" {\"When in doubt, punt.\"}\r\n Default {\"nothing returned\"}\r\n}\r\n.Example\r\nPS C:\\&gt; New-MessageBox -message \"Are you the walrus?\" -icon question -title \"Hey, Jude\" -button YesNo\r\n.Inputs\r\nNone\r\n.Outputs\r\n[system.string]\r\n#&gt;\r\n\r\n[cmdletbinding()]\r\n\r\nParam (\r\n[Parameter(Position=0,Mandatory,HelpMessage=\"Specify a display message\")]\r\n[ValidateNotNullorEmpty()]\r\n[string]$Message,\r\n[ValidateSet(\"OkOnly\",\"OkCancel\",\"AbortRetryIgnore\",\"YesNoCancel\",\"YesNo\",\"RetryCancel\")]\r\n[string]$Button=\"OkOnly\",\r\n[ValidateSet(\"Critical\", \"Question\", \"Exclamation\", \"Information\")]\r\n[string]$Icon=\"Information\",\r\n[string]$Title,\r\n[switch]$NoPassthru\r\n)\r\n\r\n#load the necessary assembly\r\nTry { \r\n    Add-Type -AssemblyName \"Microsoft.VisualBasic\" -ErrorAction Stop     \r\n    #create the message box using the parameter values\r\n    $returnValue = [microsoft.visualbasic.interaction]::Msgbox($message,\"$button,$icon\",$title)\r\n}\r\nCatch {\r\n    Write-Warning \"Failed to add Microsoft.VisualBasic assembly or create the messagebox.\"\r\n    Write-Warning $error[0].Exception.Message\r\n}\r\n#do not write return value if -NoPassthru is called\r\nif (-Not $NoPassthru) {\r\n    Write-Output $returnValue\r\n}\r\n\r\n} #end function<\/pre>\n<p>Most of the function is a wrapper around this line:<\/p>\n<pre class=\"lang:default decode:true\">$returnValue = [microsoft.visualbasic.interaction]::Msgbox($message,\"$button,$icon\",$title)<\/pre>\n<p>Like the popup function, I wanted to make it easier to create a messagebox without having to remember the names for buttons and icons so I use validation sets with my parameters. This makes it much easier to create a command like this in your script:<\/p>\n<pre class=\"lang:default decode:true\">New-Messagebox -Message \"Do you want to delete the files?\" -Button YesNoCancel -Icon Question -Title \"Are you sure?\"<\/pre>\n<p>In the version I presented at the PowerShell Summit, the function did not write anything to the pipeline unless you used -Passthru. After thinking about it more, I realized the whole reason you are likely to use a MessageBox is to capture an interaction so I flipped the parameter and now it is -NoPassthru. Now, when the user clicks a button, the text value of that button is automatically written to the pipeline. If you include -NoPassthru you'll get nothing. Here's an example:<\/p>\n<pre class=\"lang:default decode:true\">$ask = New-Messagebox -Message \"Do you want to delete all objects in Active Directory?\" -Button YesNo -Icon Exclamation -Title \"What are you thinking?\"\r\nif ($ask -eq \"yes\") {\r\n Write-Host \"Updating resume...\" -ForegroundColor Red\r\n #evil code\r\n}\r\nelse {\r\n Write-Host \"Sanity restored\" -ForegroundColor Green\r\n}<\/pre>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3006\" alt=\"messagebox2\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox2.png\" width=\"396\" height=\"172\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox2.png 396w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox2-300x130.png 300w\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" \/><\/a><\/p>\n<p>Because the messagebox writes text to the pipeline, it is a little easier to use than the Popup technique where you have to decode an integer value. In any event, you now have some options.<\/p>\n<p>If you find this useful, I hope you'll let me know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 the popup except the user&#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":"New Blog post: #PowerShell Messagebox","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":[259,534,540,535],"class_list":["post-3004","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-messagebox","tag-powershell","tag-scripting","tag-vbscript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell Messagebox &#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\/3004\/powershell-messagebox\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell Messagebox &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"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 the popup except the user...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-08T12:27:01+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.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\\\/3004\\\/powershell-messagebox\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell Messagebox\",\"datePublished\":\"2013-05-08T12:27:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/\"},\"wordCount\":293,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/05\\\/messagebox-300x147.png\",\"keywords\":[\"MessageBox\",\"PowerShell\",\"Scripting\",\"VBScript\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/\",\"name\":\"PowerShell Messagebox &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/05\\\/messagebox-300x147.png\",\"datePublished\":\"2013-05-08T12:27:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/05\\\/messagebox.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/05\\\/messagebox.png\",\"width\":349,\"height\":172},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3004\\\/powershell-messagebox\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell Messagebox\"}]},{\"@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 Messagebox &#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\/3004\/powershell-messagebox\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell Messagebox &#8226; The Lonely Administrator","og_description":"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 the popup except the user...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-05-08T12:27:01+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.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\/3004\/powershell-messagebox\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell Messagebox","datePublished":"2013-05-08T12:27:01+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/"},"wordCount":293,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.png","keywords":["MessageBox","PowerShell","Scripting","VBScript"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/","name":"PowerShell Messagebox &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox-300x147.png","datePublished":"2013-05-08T12:27:01+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/messagebox.png","width":349,"height":172},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"PowerShell Messagebox"}]},{"@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":3665,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3665\/friday-fun-messagebox-writer\/","url_meta":{"origin":3004,"position":0},"title":"Friday Fun: Messagebox Writer","author":"Jeffery Hicks","date":"January 31, 2014","format":false,"excerpt":"For today's fun I'm revisiting a topic I'm sure I've written about in the past and that is creating a graphical message box in PowerShell. There are a few ways you can do this from using the Visual Basic classes, the old standard WScript.Shell object from VBScript or using WinForms.\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"yellowsub","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/yellowsub.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1185,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/","url_meta":{"origin":3004,"position":1},"title":"Friday Fun Get MessageBox","author":"Jeffery Hicks","date":"March 4, 2011","format":false,"excerpt":"Today's Friday Fun offers a way for you to graphically interact with your PowerShell scripts and functions without resorting to a lot of complex Winform scripting. I have a function that you can use to display an interactive message box complete with buttons like Yes, No or Cancel. You can\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\/03\/msgbox.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2016,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2016\/friday-fun-a-powershell-alarm-clock\/","url_meta":{"origin":3004,"position":2},"title":"Friday Fun: A PowerShell Alarm Clock","author":"Jeffery Hicks","date":"January 20, 2012","format":false,"excerpt":"Today's Friday Fun is a continuation of my exploration of ways to use Start-Job. A few weeks ago I wrote about using Start-Job to create \"scheduled\" tasks. I realized I could take this further and turn this into a sort of alarm clock. The goal is to execute at command\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\/2012\/01\/new-alarm-help-300x197.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2976,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2976\/powershell-popup\/","url_meta":{"origin":3004,"position":3},"title":"PowerShell PopUp","author":"Jeffery Hicks","date":"April 29, 2013","format":false,"excerpt":"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\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"popup","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/04\/popup-300x139.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":115,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/115\/vbscript-training-in-las-vegas\/","url_meta":{"origin":3004,"position":4},"title":"VBScript Training in Las Vegas","author":"Jeffery Hicks","date":"August 24, 2007","format":false,"excerpt":"I will be doing a live 2 day VBScript class this fall in Las Vegas (Oct. 22 and 23). I'll be covering ADSI, WMI, HTAs, WSF and more. This is a class for experienced VBScripters who want to take it to the next level. This is a hands on class\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":41,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/41\/autographed-copies-of-advanced-vbscript\/","url_meta":{"origin":3004,"position":5},"title":"Autographed copies of Advanced VBScript","author":"Jeffery Hicks","date":"August 4, 2006","format":false,"excerpt":"If you haven't picked up a copy of Advanced VBScript for Microsoft Windows Administrators, you can purchase autographed copies at ScriptingOutpost.com at a great price. The books are signed by Don and myself.Visit http:\/\/www.scriptingoutpost.com\/ProductInfo.aspx?productid=BK-ADV-VBSTechnorati Tags:VBScriptScripting","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\/3004","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=3004"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3004\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}