{"id":1101,"date":"2011-02-04T10:44:34","date_gmt":"2011-02-04T15:44:34","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1101"},"modified":"2011-03-28T08:26:15","modified_gmt":"2011-03-28T12:26:15","slug":"friday-fun-more-powershell-bingo","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/","title":{"rendered":"Friday Fun &#8211; More PowerShell Bingo"},"content":{"rendered":"<p>For <a href=\"http:\/\/jdhitsolutions.com\/blog\/2011\/01\/friday-fun-lets-play-bingo\/\" target=\"_blank\">last week's Friday Fun<\/a>, I posted a PowerShell script to create a traditional Bingo card. I hoped you would also learn a few PowerShell concepts along the way. This week I've taken this to the next level, and have a complete module that not only creates the card but also let's you play the game. There's a lot going on here with regular expressions, custom view PS1XML files, variable scope and more.<!--more--><\/p>\n<p>There's so much here I'm not even sure where to begin. I hope when you download the module you'll take some time to go through the different script files to understand how all the pieces work. I've tried to comment alot to help, as I recommend you do in your scripts. But let me hit a few key PowerShell concepts and techniques.<\/p>\n<p>First off, I now have a function to generate a Bingo number, using the traditional Bingo values. The Get-BingoNumber function breaks a few rules which is why I want you to understand.  The challenge was to ensure that every number drawn was unique and had not been played before which meant I needed some mechanism to keep track of the draw history. Normally I would use a variable array. But everytime I call the function, I would end up with a new scope and new variables. This is a situation where specifying a scope comes in handy. <\/p>\n<p>The Get-BingoNumber function creates a variable, $Master, in the global scope of all possible values.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n#if no global variable for $master is found then create it<br \/>\nif (-Not $global:master)<br \/>\n{<br \/>\n    #generate unique arrays of numbers for each letter,<br \/>\n    #create a letter\/number combination<br \/>\n    #and then randomize again for good measure<br \/>\n    $B=1..15  | Get-Random -count 15 | foreach {write \"B$_\"} | Get-Random -count 15<br \/>\n    $I=16..30 | Get-Random -count 15 | foreach {write \"I$_\"} | Get-Random -count 15<br \/>\n    $N=31..45 | Get-Random -count 15 | foreach {write \"N$_\"} | Get-Random -count 15<br \/>\n    $G=46..60 | Get-Random -count 15 | foreach {write \"G$_\"} | Get-Random -count 15<br \/>\n    $O=61..75 | Get-Random -count 15 | foreach {write \"O$_\"} | Get-Random -count 15<\/p>\n<p>    #build a master array of all possible numbers<br \/>\n    $global:master=$B+$I+$N+$G+$O<br \/>\n}<br \/>\n[\/cc]<br \/>\nThe function then draws a random element from this variable.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n#create a randomized array of $master if it doesn't already exist<br \/>\nif (-not $global:draw)<br \/>\n{<br \/>\n    $global:draw= $global:master | Get-Random -count $global:master.count<br \/>\n}<br \/>\n#Draw each number from $draw starting at the beginning of the array<br \/>\nWrite-Output $global:draw[0]<br \/>\n#remove the first element from $draw<br \/>\n$global:draw=$global:draw[1..$($global:draw.count)]<br \/>\n[\/cc]<br \/>\nThis is the value that is written to the pipeline. Without specifying the global scope I would get new variables every time. Using a variable with the scope prefix let's PowerShell know I understand what I am doing. <\/p>\n<p>For the Bingo card object, I realized I didn't have to rely on Format-Table or tweaking the output. I could use a custom format file.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n<?xml version=\"1.0\" encoding=\"utf-8\" ?><br \/>\n<Configuration><br \/>\n    <ViewDefinitions><br \/>\n        <View><br \/>\n         <Name>Bingo.Card<\/Name><br \/>\n            <ViewSelectedBy><br \/>\n                <TypeName>Bingo.Card<\/TypeName><br \/>\n            <\/ViewSelectedBy><br \/>\n            <TableControl><br \/>\n                <TableHeaders><br \/>\n                    <TableColumnHeader><br \/>\n                        <Label>B<\/Label><br \/>\n                        <Width>4<\/Width><br \/>\n                    <\/TableColumnHeader><br \/>\n                    <TableColumnHeader><br \/>\n                        <Label>I<\/Label><br \/>\n                        <Width>4<\/Width><br \/>\n                    <\/TableColumnHeader><br \/>\n                    <TableColumnHeader><br \/>\n                        <Label>N<\/Label><br \/>\n                        <Width>4<\/Width><br \/>\n                    <\/TableColumnHeader><br \/>\n                    <TableColumnHeader><br \/>\n                        <Label>G<\/Label><br \/>\n                        <Width>4<\/Width><br \/>\n                    <\/TableColumnHeader><br \/>\n                    <TableColumnHeader><br \/>\n                        <Label>O<\/Label><br \/>\n                        <Width>4<\/Width><br \/>\n                    <\/TableColumnHeader><br \/>\n                <\/TableHeaders><br \/>\n                <TableRowEntries><br \/>\n                    <TableRowEntry><br \/>\n                        <TableColumnItems><br \/>\n                            <TableColumnItem><br \/>\n                                <PropertyName>B<\/PropertyName><br \/>\n                            <\/TableColumnItem><br \/>\n                            <TableColumnItem><br \/>\n                                <PropertyName>I<\/PropertyName><br \/>\n                            <\/TableColumnItem><br \/>\n                            <TableColumnItem><br \/>\n                                <PropertyName>N<\/PropertyName><br \/>\n                            <\/TableColumnItem><br \/>\n                           <TableColumnItem><br \/>\n                                <PropertyName>G<\/PropertyName><br \/>\n                            <\/TableColumnItem><br \/>\n                           <TableColumnItem><br \/>\n                                <PropertyName>O<\/PropertyName><br \/>\n                            <\/TableColumnItem><br \/>\n                        <\/TableColumnItems><br \/>\n                    <\/TableRowEntry><br \/>\n                 <\/TableRowEntries><br \/>\n            <\/TableControl><br \/>\n        <\/View><br \/>\n   <\/ViewDefinitions><br \/>\n<\/Configuration><br \/>\n [\/cc]<br \/>\nWhen this file is loaded from the module, or using Update-FormatData, my bingo card objects are properly formatted. But there was one extra trick I needed for this to work.  Originally I was creating the bingo card using New-Object.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n$obj=New-Object -TypeName PSObject -Property @{<br \/>\n        B=$b[$x]<br \/>\n        I=$i[$x]<br \/>\n        N=$n[$x]<br \/>\n        G=$g[$x]<br \/>\n        O=$o[$x]<br \/>\n     }<br \/>\n[\/cc]<br \/>\nBut this meant the object type was a PSCustomObject so my original version of my format ps1xml file applied to all custom objects as long as the module was loaded. The trick was to assign a new object type to this object.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n#add a custom type name to this object for formatting<br \/>\n$obj.psobject.Typenames[0]=\"Bingo.Card\"<br \/>\n[\/cc]<br \/>\nYou'll notice that this type name matches the type name in the ps1xml file. Now whenever I write a card to the pipeline it is automatically formatted the way I want.<\/p>\n<p>When it comes to playing the game, I wrote a new function called Invoke-Bingo which has an alias of Play-Bingo (since Play is not a valid verb but it is OK for an alias). The function uses a number of parameter sets because you can play 3 different ways. In the default or Normal manner a new card is written to your console and a prompt awaits your first number. At the same time a second PowerShell window is open that loads the module and launches the Get-PowerShellNumber function in Prompt mode. You get numbers from one session and enter them in the other.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-1024x519.png\" alt=\"\" title=\"powershellbingo\" width=\"640\" height=\"324\" class=\"aligncenter size-large wp-image-1103\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-1024x519.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-300x152.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo.png 1361w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Because the game displays winning numbers (look at the Test-Bingo.ps1 file to see how), I wanted to make sure only valid numbers were entered. So I used a set of regular expressions to validate.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n#use regular expression to make sure a valid call was made<br \/>\n        Switch -regex ($call) {<br \/>\n            \"^[bB]([1-9]|[1][0-5])$\" {$valid=$True}<br \/>\n            \"^[iI]([1][5-9]|[2][0-9]|[3][0])$\" {$valid=$True}<br \/>\n            \"^[nN]([3][1-9]|[4][0-5])$\" {$valid=$True}<br \/>\n            \"^[gG]([4][6-9]|[5][0-9]|[6][0])$\" {$valid=$True}<br \/>\n            \"^[oO]([6][1-9]|[7][0-5])$\" {$valid=$True}<br \/>\n            Default {<br \/>\n                $valid=$False<br \/>\n                Write-Warning \"$Call is an invalid option. Please try again.\"<br \/>\n                }<br \/>\n        } #Switch<br \/>\n[\/cc]<\/p>\n<p>You can also use -CardOnly to skip the draw session. Use this if you are playing along with your co-workers and someone else is drawing numbers. By the way, the free space is now randomly inserted and you can have up to 3. Use -Free when playing.<\/p>\n<p>Lastly, I also created an AutoPlay mode. that automatically draws a number and updates the card whenever there is a match. Play continues until a Bingo is made. You can specify a sleep interval between draws. The default is 3 with a minimum of 1. Here's a short 30 second clip of an automatic game. The game itself took a little over a minute.<br \/>\n[kml_flashembed publishmethod=\"static\" fversion=\"8.0.0\" movie=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/PowerShellBingo.swf\" width=\"640\" height=\"374\" targetclass=\"flashmovie\" play=\"false\" quality=\"high\" base=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/\" fvars=\"autostart=false;thumb=FirstFrame.png;thumbscale=45;color=0x1A1A1A,0x1A1A1A\"]<\/p>\n<p><a href=\"http:\/\/adobe.com\/go\/getflashplayer\"><img decoding=\"async\" src=\"http:\/\/www.adobe.com\/images\/shared\/download_buttons\/get_flash_player.gif\" alt=\"Get Adobe Flash player\" \/><\/a><\/p>\n<p>[\/kml_flashembed]<\/p>\n<p>Download the<a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/PowerShellBingo.zip'>PowerShellBingo<\/a> module. Extract the folder to Documents\\WindowsPowerShell\\Modules and then import the PowerShellBingo module. Enjoy, and I hope you learn a few things along the way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For last week&#8217;s Friday Fun, I posted a PowerShell script to create a traditional Bingo card. I hoped you would also learn a few PowerShell concepts along the way. This week I&#8217;ve taken this to the next level, and have a complete module that not only creates the card but also let&#8217;s you play the&#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,4],"tags":[240,245,205,534,140,25],"class_list":["post-1101","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-formatting","tag-get-random","tag-modules","tag-powershell","tag-ps1xml","tag-tipsheet"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun - More PowerShell Bingo &#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\/1101\/friday-fun-more-powershell-bingo\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun - More PowerShell Bingo &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"For last week&#039;s Friday Fun, I posted a PowerShell script to create a traditional Bingo card. I hoped you would also learn a few PowerShell concepts along the way. This week I&#039;ve taken this to the next level, and have a complete module that not only creates the card but also let&#039;s you play the...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-02-04T15:44:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-03-28T12:26:15+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-1024x519.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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun &#8211; More PowerShell Bingo\",\"datePublished\":\"2011-02-04T15:44:34+00:00\",\"dateModified\":\"2011-03-28T12:26:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/\"},\"wordCount\":1041,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/02\\\/powershellbingo-1024x519.png\",\"keywords\":[\"formatting\",\"Get-Random\",\"modules\",\"PowerShell\",\"ps1xml\",\"TipSheet\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/\",\"name\":\"Friday Fun - More PowerShell Bingo &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/02\\\/powershellbingo-1024x519.png\",\"datePublished\":\"2011-02-04T15:44:34+00:00\",\"dateModified\":\"2011-03-28T12:26:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/02\\\/powershellbingo.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/02\\\/powershellbingo.png\",\"width\":\"1361\",\"height\":\"690\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1101\\\/friday-fun-more-powershell-bingo\\\/#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; More PowerShell Bingo\"}]},{\"@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 - More PowerShell Bingo &#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\/1101\/friday-fun-more-powershell-bingo\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun - More PowerShell Bingo &#8226; The Lonely Administrator","og_description":"For last week's Friday Fun, I posted a PowerShell script to create a traditional Bingo card. I hoped you would also learn a few PowerShell concepts along the way. This week I've taken this to the next level, and have a complete module that not only creates the card but also let's you play the...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-02-04T15:44:34+00:00","article_modified_time":"2011-03-28T12:26:15+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-1024x519.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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun &#8211; More PowerShell Bingo","datePublished":"2011-02-04T15:44:34+00:00","dateModified":"2011-03-28T12:26:15+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/"},"wordCount":1041,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-1024x519.png","keywords":["formatting","Get-Random","modules","PowerShell","ps1xml","TipSheet"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/","name":"Friday Fun - More PowerShell Bingo &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo-1024x519.png","datePublished":"2011-02-04T15:44:34+00:00","dateModified":"2011-03-28T12:26:15+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/powershellbingo.png","width":"1361","height":"690"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1101\/friday-fun-more-powershell-bingo\/#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; More PowerShell Bingo"}]},{"@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":3562,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3562\/friday-fun-theme-me-up\/","url_meta":{"origin":1101,"position":0},"title":"Friday Fun: Theme Me Up!","author":"Jeffery Hicks","date":"November 15, 2013","format":false,"excerpt":"When PowerShell 3.0 came out, one of the compelling features was a re-vamped PowerShell ISE. Options in the ISE included the ability to fine-tune and customize the appearance including items like font, token colors, and screen colors. If I recall correctly, in PowerShell 2.0, if you wanted to customize the\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"crayons","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/crayons-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4061,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4061\/friday-fun-lets-play-a-game\/","url_meta":{"origin":1101,"position":1},"title":"Friday Fun &#8211; Let&#8217;s Play a Game","author":"Jeffery Hicks","date":"October 3, 2014","format":false,"excerpt":"Today is going to be a lot of fun. A few years ago, back when we were still running PowerShell 2.0 everywhere, I created a module to run a Bingo game in a PowerShell session. I primarily wrote the module as a learning tool for beginners wanting to know more\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"BingoCard-small","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/10\/BingoCard-small.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1085,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1085\/friday-fun-lets-play-bingo\/","url_meta":{"origin":1101,"position":2},"title":"Friday Fun: Let&#8217;s Play Bingo!","author":"Jeffery Hicks","date":"January 28, 2011","format":false,"excerpt":"Today Campers we're playing Bingo. Or at least getting ready to. This week I have some PowerShell code that will create a BINGO card. For those of you outside of North America you might need to take a crash course on this game. But even if you don't play, this\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":"","width":0,"height":0},"classes":[]},{"id":7680,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7680\/friday-fun-back-to-school-with-powershell\/","url_meta":{"origin":1101,"position":3},"title":"Friday Fun: Back to School with PowerShell","author":"Jeffery Hicks","date":"September 11, 2020","format":false,"excerpt":"For today's fun with PowerShell, I thought I'd share my solutions for a recent Iron Scripter challenge. If you aren't familiar with these challenges, and you should be, they are designed to test your PowerShell skills and hopefully help you learn something new. There are challenges for all skill levels\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\/2020\/09\/get-cylindervolume-format.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-cylindervolume-format.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-cylindervolume-format.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-cylindervolume-format.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8215,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8215\/powershell-property-sets-to-the-rescue\/","url_meta":{"origin":1101,"position":4},"title":"PowerShell Property Sets to the Rescue","author":"Jeffery Hicks","date":"March 11, 2021","format":false,"excerpt":"if you are like me and spend most of your day at a PowerShell prompt, anything that simplifies that process is worth the time to learn or set up. Even though I am a decent typist, I am more than happy to find ways to type less at a PowerShell\u2026","rel":"","context":"In &quot;GitHub&quot;","block_context":{"text":"GitHub","link":"https:\/\/jdhitsolutions.com\/blog\/category\/github\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2330,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2330\/friday-fun-get-latest-powershell-scripts\/","url_meta":{"origin":1101,"position":5},"title":"Friday Fun: Get Latest PowerShell Scripts","author":"Jeffery Hicks","date":"May 18, 2012","format":false,"excerpt":"Probably like many of you I keep almost all of my scripts in a single location. I'm also usually working on multiple items at the same time. Some times I have difficult remembering the name of a script I might have been working on a few days ago that I\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\/05\/get-latestscript-300x133.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1101","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=1101"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1101\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}