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

The PowerShell Magic 8 Ball

Posted on October 28, 2019October 27, 2020

[I updated this article to reflect minor changes in the code and the release of PowerShell 7. This article was originally published 28 October, 2019].

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!

Last year I shared some PowerShell code on Twitter about this time of year. I have a short script that uses Windows Presentation Foundation (WPF) to create a spooky graphical prompt that allows you to ask questions of a Magic 8 Ball (this name may be trademarked or otherwise protected). For those of you who may not be familiar with it, this is a toy shaped like a giant 8 ball from a billiards game. You ask a question aloud, shake the ball, and look at the bottom to get an answer. I did the same thing with PowerShell.

8balloracle-1

8balloracle-2

Nothing more than a little harmless fun. Although the code demonstrates how easy it is to put together a simple WPF form. The script will also run in PowerShell Core on a Windows platform

You can find the code on my GitHub account as a gist.

Trick or Treat!


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

1 thought on “The PowerShell Magic 8 Ball”

  1. Pingback: ICYMI: PowerShell Week of 1-November-2019 | PowerShell.org

Comments are closed.

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