Creating a PowerShell Weather Command Part 4
Weather Codes
I think I’m making good progress with my weather command and accompanying Pester test. I have to admit writing the Pester test first helps keep me focused on the task at hand. Part of my brain is jumping ahead to work I know I have to or want to address. Writing the test forces me to update the code in a granular fashion. Running the tests after each code update also ensures I haven’t broken anything along the way.
In the last article, I identified a few improvements. First, my function uses latitude and longitude to retrieve the weather information, but the output includes a more meaningful location property. I have been testing and developing with Redmond, WA, as my location. I could add a parameter to let the user specify the location. But I suspect I will want another command to get location information that I can pass to my weather command. I’m going to save that for next time. For now, I’m going to modify the output to use the latitude and longitude as the location.
Location = @($Latitude, $Longitude)
I also need to update the Pester test.