Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

Friday Fun – Let’s Play a Game

Posted on October 3, 2014October 2, 2015

BingoCard-smallToday 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 about how to construct a module. The module also includes examples of some techniques such as a custom format file, exporting (or not) members from a module and splatting.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

Enough time has passed since I first worked on this that I decided to revisit and update for PowerShell 3.0 and later. I've gone through and cleaned up things that I had to do in v2 that now are better handled in v3 like ordered hash tables. I've also fixed a few bugs I missed the first time and added at least one new feature.

When you load the module, you can start a new bingo game by running Invoke-Bingo. I wanted to stick to an official verb for the function. But to make life easier, the module also defines aliases, Play-Bingo and simply, Bingo. Stick to standard verbs with your functions but feel free to add aliases to make your commands more user-friendly.

When you start a new game, I have a function that creates a custom object for the Bingo card. The old version launched a separate PowerShell window to call the numbers, but I have incorporated that into the main output.

bingo-1

You keep entering numbers as they are 'called' until a winning card is detected. There are separate functions for calling numbers and testing cards.
bingo-2

In this version I also added a parameter that will create a Speech object so that your computer can speak the called numbers to you! If you want to play multiple cards, open up separate PowerShell windows and run Invoke-Bingo -Cardonly.

bingo-3

This is also handy if there are several of you wanting to play. Only one person needs to be the caller. I should get together with Boe Prox and figure out a way to run this over a remoting session!

If you want to try this out, and I hope you do, download this zip file and extract to your modules folder. As always, I hope you pick up something useful. Or if nothing else you can kill some time waiting for that server reboot to finish.

Enjoy!

[Update: A slightly revised version of this module is now on GitHub.]


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d