Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
May 4, 2023

Creating a PowerShell Weather Command

Part 1

Earlier this year I tried something new. I documented the process of creating a new PowerShell command in real time. Often, I am sharing code and commands I’ve already written. Instead, over the course of the next several weeks, I don’t know exactly since I haven’t written anything yet, I want to share my experiences creating a PowerShell weather command based on free Open-Meteo weather API. The development process will hopefully expose you to new techniques and concepts.

I’ve also decided I’m going to take a test-driven development approach. Normally, I write my code, and then I create my Pester tests. Although, to be honest, I’m probably a lot like many of you and never really do. I’m going to bite the bullet and give it a go. I expect I will learn as much from this process as you.

Start with a Command

Before I get to the test, I want to have a basic command that runs interactively in the PowerShell console. The function, or functions I write, will be wrapped around a core set of commands. When I visit the Open-Meteo.com site, there is a curl example.

Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.