{"id":1185,"date":"2011-03-04T09:01:31","date_gmt":"2011-03-04T14:01:31","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1185"},"modified":"2011-03-28T08:24:00","modified_gmt":"2011-03-28T12:24:00","slug":"friday-fun-get-messagebox","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/","title":{"rendered":"Friday Fun Get MessageBox"},"content":{"rendered":"<p>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 either use the message box to display a message to the user or return input.<!--more--><\/p>\n<p>The function is a wrapper for the MsgBox() method of the [Microsoft.VisualBasic.Interaction] .NET class.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Get-MessageBox {<br \/>\n   Param (<br \/>\n    [Parameter(Position=0,Mandatory=$True,HelpMessage=\"Specify a display message\")]<br \/>\n    [ValidateNotNullorEmpty()]<br \/>\n    [ValidateScript({$_.Length -le 1024})]<br \/>\n    [string]$Message,<\/p>\n<p>    [ValidateSet(\"OkOnly\",\"OkCancel\",\"AbortRetryIgnore\",\"YesNoCancel\",\"YesNo\",\"RetryCancel\")]<br \/>\n    [string]$Button=\"OkOnly\",<\/p>\n<p>    [ValidateSet(\"Critical\", \"Question\", \"Exclamation\", \"Information\")]<br \/>\n    [string]$Icon=\"Information\",<\/p>\n<p>    [string]$Title,<br \/>\n    [switch]$Passthru<br \/>\n    )<\/p>\n<p>    #load the required .NET assembly<br \/>\n    Add-Type -AssemblyName \"Microsoft.VisualBasic\"<br \/>\n    #Invoke the message box and save the value from any button clicks to a variable<br \/>\n    $returnValue=[Microsoft.Visualbasic.Interaction]::Msgbox($message,\"$button,$icon\",$title)<\/p>\n<p>    #write return value if -Passthru is called<br \/>\n    if ($passthru)<br \/>\n    {<br \/>\n        Write-Output $returnValue<br \/>\n    }<\/p>\n<p>} #end function<br \/>\n[\/cc]<\/p>\n<p>The method allows you to specify the message text (up to 1024 characters), an icon, a button set and a title. The only value you really need to specify is a message. The default icon is Information and the default title is blank. The function uses the ValidateSet attribute to verify that the right value is specified for icon and title. <\/p>\n<p>When you run this function, the user has to click on one of the buttons. The return value is stored in a variable.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$returnValue=[Microsoft.Visualbasic.Interaction]::Msgbox($message,\"$button,$icon\",$title)<br \/>\n[\/cc]<\/p>\n<p>I wrote the function assuming that most of the time all you want is to present an informational message with an OK button which means you don't really need to see the return value. Thus the default behavior is NOT to write it to the pipeline. However, if you use -Passthru, then the value will be written to the pipeline. This allows you to use code like:<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$rc=Get-Messagebox -message \"Do you know what you're doing?\" -icon \"exclamation\" -button \"YesNoCancel\" -title \"Hey $env:username!!\" -passthru<\/p>\n<p>Switch ($rc) {<br \/>\n \"Yes\" {\"I hope your resume is up to date.\"}<br \/>\n \"No\" {\"Wise move.\"}<br \/>\n \"cancel\" {\"When in doubt, punt.\"}<br \/>\n Default {\"nothing returned\"}<br \/>\n}<br \/>\n[\/cc]<\/p>\n<p>Here's the actual message box.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png\" alt=\"\" title=\"msgbox\" width=\"349\" height=\"171\" class=\"aligncenter size-full wp-image-1186\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png 349w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox-300x146.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/a><\/p>\n<p>The message parameter value must be a string and you can create multi-line entries using `n.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n PS C:\\> $m=\"Hello $env:username `n It is now $(Get-Date)\"<br \/>\n PS C:\\> Get-MessageBox -Message $m -Title \"Greeting\"<br \/>\n[\/cc]<\/p>\n<p>The script file with the function also includes an optional alias, gmd. You can download the script file <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/Get-MessageBox.txt' target='_blank'>here<\/a>.  The full script also has comment-based help. Enjoy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;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 either use the message box&#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":[260,224,259,534],"class_list":["post-1185","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell-v2-0","category-scripting","tag-add-type","tag-function","tag-messagebox","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun Get 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\/scripting\/1185\/friday-fun-get-messagebox\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun Get MessageBox &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Today&#039;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 either use the message box...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-04T14:01:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-03-28T12:24:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.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\\\/1185\\\/friday-fun-get-messagebox\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun Get MessageBox\",\"datePublished\":\"2011-03-04T14:01:31+00:00\",\"dateModified\":\"2011-03-28T12:24:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/\"},\"wordCount\":456,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/03\\\/msgbox.png\",\"keywords\":[\"Add-Type\",\"Function\",\"MessageBox\",\"PowerShell\"],\"articleSection\":[\"Friday Fun\",\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/\",\"name\":\"Friday Fun Get MessageBox &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/03\\\/msgbox.png\",\"datePublished\":\"2011-03-04T14:01:31+00:00\",\"dateModified\":\"2011-03-28T12:24:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/03\\\/msgbox.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/03\\\/msgbox.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1185\\\/friday-fun-get-messagebox\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun Get 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":"Friday Fun Get 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\/scripting\/1185\/friday-fun-get-messagebox\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun Get MessageBox &#8226; The Lonely Administrator","og_description":"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 either use the message box...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-03-04T14:01:31+00:00","article_modified_time":"2011-03-28T12:24:00+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.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\/1185\/friday-fun-get-messagebox\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun Get MessageBox","datePublished":"2011-03-04T14:01:31+00:00","dateModified":"2011-03-28T12:24:00+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/"},"wordCount":456,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png","keywords":["Add-Type","Function","MessageBox","PowerShell"],"articleSection":["Friday Fun","PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/","name":"Friday Fun Get MessageBox &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png","datePublished":"2011-03-04T14:01:31+00:00","dateModified":"2011-03-28T12:24:00+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/msgbox.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1185\/friday-fun-get-messagebox\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun Get 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":1185,"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":3004,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3004\/powershell-messagebox\/","url_meta":{"origin":1185,"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":2016,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2016\/friday-fun-a-powershell-alarm-clock\/","url_meta":{"origin":1185,"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":3543,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3543\/more-powershell-trace-window-fun\/","url_meta":{"origin":1185,"position":3},"title":"More PowerShell Trace Window Fun","author":"Jeffery Hicks","date":"November 6, 2013","format":false,"excerpt":"On my last Friday Fun, I posted an article about using Internet Explorer as a trace window. The idea was to put debug or trace messages in a separate application. I received a comment on the post that suggested I could do a similar thing using the Debug View utility\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"dbgview-trace","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/dbgview-trace-300x290.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9187,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9187\/friday-fun-powershell-scripting-with-chatgpt\/","url_meta":{"origin":1185,"position":4},"title":"Friday Fun: PowerShell Scripting with ChatGPT","author":"Jeffery Hicks","date":"December 16, 2022","format":false,"excerpt":"I have been trying out the latest AI, ChatGPT. I've asked it silly questions. As well as the really important questions. But what I find most fascinating is using ChatGPT to write PowerShell code. I gave the AI this instruction: \"Write a PowerShell function that will display \"Hello, World\" in\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\/2022\/12\/woodchuck.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/12\/woodchuck.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/12\/woodchuck.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/12\/woodchuck.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/12\/woodchuck.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/12\/woodchuck.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":4011,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4011\/friday-fun-a-popup-alternative\/","url_meta":{"origin":1185,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1185","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=1185"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1185\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}