I came across some fun stuff on the internet, so I wrote a quick wrapper to make a Powershell weather forecasting Function for this blog post.

The idea is to get the weather report in Powershell console using this  cURL implementation converted into Powershell function below

PowerShell Weather Forecasting Function:

Just pass a name of the City as a parameter to the Function to get the weather report of the day.

PowerShell Weather

You can pass values through the pipeline as well.

PowerShell Weather forecast

Use ‘-Tomorrow‘ and ‘-DayAfterTomorrow‘ to check the weather of later than today.

PowerShell Weather

To add this script to your Powershell profile run the below piece of code and you are good to go

If you like this article, you may want to take a look at my Web and Native API Blog series for similar and other interesting implementations in PowerShell.

Don’t forget to show off your Powershell-Weather skills to your colleagues, Cheers! 😉

Subscribe to our mailing list

* indicates required