Skip to content
The Lazy Administrator
  • Home
  • Disclaimer
  • Contact
  • About Me
  • Search Icon

The Lazy Administrator

Finding ways to do the most work with the least effort possible

Play Wordle, the Puzzle Game Using PowerShell

Play Wordle, the Puzzle Game Using PowerShell

January 4, 2022 Brad Wyatt Comments 2 comments

Table of Contents

  • Install the Module
  • Start a New Game
  • Enable Emoji Responses
  • Word List

I recently came across a NYTimes article talking about a new game called, ‘Wordle.’ If you are not familiar with the game, its a text-based game where you have 6 tries to guess the word. Letters in a Gray box are not letters found in the word. Letters in a Yellow box are found in the word, but are in the incorrect spot. And finally, letters in a Green box are in the word and in the correct location.

After playing, I decided to see how I could transport the game over to PowerShell because why not? After a few hours I got it working and uploaded to the PowerShell Gallery so everyone can play. Below, I will talk more in depth about some of the features, how to install the module, and how to create a new game.

Install the Module

The module is uploaded to the PowerShell Gallery, so to install it you just need to open a administrative PowerShell prompt and run Install-Module PSWordle

You can also install it manually, view, or contribute to the code by navigating to it on GitHub.

Start a New Game

Once you have the module installed, to begin a new game you just need to run New-WordleGame. From there, it will generate a random word for you to guess, prompt you for your input, and also explain the rules of the game. If you are not able to guess the word in the 6 tries it will display the word at the end. If you guess a letter that is not in the word, it will color the letter DarkGray and also keep a rolling record which will be displayed to you on each turn. If you guess a letter that is present in the word, but in the incorrect spot, it will color it Yellow. And finally, if you guess a correct letter and it is in the correct spot, it will color it Green. (More on the code behind the colorization of letters and words in a later article.)

Enable Emoji Responses

The function, ‘New-WordleGame’ contains one optional parameter, ‘-UseEmojiResponse’ which will respond back with either Yellow, Green, or Black colored square emojis instead of coloring the letters.

Word List

The word list contains hundreds and hundreds on entries. Using Invoke-RestMethod, the module grabs a random word from the following GitHub list: https://raw.githubusercontent.com/charlesreid1/five-letter-words/master/sgb-words.txt

Brad Wyatt
Brad Wyatt

My name is Bradley Wyatt; I am a 5x Microsoft Most Valuable Professional (MVP) in Microsoft Azure and Microsoft 365. I have given talks at many different conferences, user groups, and companies throughout the United States, ranging from PowerShell to DevOps Security best practices, and I am the 2022 North American Outstanding Contribution to the Microsoft Community winner.


PowerShell
Games, PowerShell, Puzzle, Wordle

Post navigation

PREVIOUS
From Standard User to Elevated Administrator: Run Elevated PowerShell Commands with PowerShell Studio and Impersonation
NEXT
A PowerShell Game you can Compete with People Online – Feature Update to PSWordle

2 thoughts on “Play Wordle, the Puzzle Game Using PowerShell”

  1. Stephanie says:
    January 5, 2022 at 12:21 pm

    I am not sure where this game is and is it that text set at the bottom where it explains sort of what to g
    Do. I just guess a word or do you give me clues

    Reply
    1. Brad Wyatt says:
      January 5, 2022 at 2:39 pm

      To create a new game, once you have the module installed run New-WordleGame in PowerShell. The game will think of a 5 character word for you to guess in 6 tries. Green letter means the letter is in the word and you have it in the correct spot within the word. Yellow means the letter is in the word but you have it in the wrong spot. Gray means the letter is nowhere in the word. After 6 guesses if you haven’t guessed the word, it will tell you what the word was.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe

Email


Categories

  • Active Directory (8)
  • AI (3)
  • API (1)
  • AutoPilot (2)
  • Azure (15)
  • Bicep (4)
  • Connectwise (1)
  • Defender for Cloud Apps (1)
  • Delegated Admin (1)
  • DevOps (6)
  • Graph (6)
  • Intune (15)
  • LabTech (1)
  • Microsoft Teams (6)
  • Office 365 (19)
  • Permissions (2)
  • PowerShell (50)
  • Security (1)
  • SharePoint (3)
  • Skype for Business (1)
  • Terraform (1)
  • Uncategorized (2)
  • Yammer (1)

Recent Comments

  • MD SHARIQUE AKHTAR on Modern Active Directory – An update to PSHTML-AD-Report
  • TommyBoich on How The ConnectWise Manage API Handles Pagination with PowerShell
  • LOTTERY 365 LOGIN on Windows LAPS Management, Configuration and Troubleshooting Using Microsoft Intune
  • SPRUNKI PHASE 6 on Get a New Computer’s Auto Pilot Hash Without Going Through the Out of Box Experience (OOBE)
  • Mohammad Sherbaji on Get a New Computer’s Auto Pilot Hash Without Going Through the Out of Box Experience (OOBE)

1,738,783 People Reached

© 2025   All Rights Reserved.