One Liner: Get the Weather with Powershell

Here’s a fun little one liner I use to send the weather to our internal IT dashboard at the office.

Invoke-RestMethod "wttr.in" -UserAgent curl

You should get something similar to this.

You can even do things like send the output to a .png file.

 Invoke-RestMethod "wttr.in/.png" -UserAgent curl -Outfile .\weather.png

It’s smart enough to determine your location automagically, but you can also specify a particular location if you’d like.

Get the complete configuration information https://wttr.in/:help

Enjoy!

Leave a Reply

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