Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

What’s the Weather?

Posted on September 23, 2015September 23, 2015

clouds I have used a PowerShell module I wrote a while ago to retrieve weather information from Yahoo.com. Yahoo offers a set of web APIs which are free to use, that will provide weather information for a given location. The location is determined by a "Where On Earth ID", or woeid. Fortunately, there are APIs to get that information as well. All of this is very easy to use with the Invoke-Webrequest cmdlet. The result is an XML document, which takes a little bit of work to parse out.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

My module has a command to get a woeid:

Once you know that you can get weather information.

Or more detailed information:

You can even pipe one command to the other.

The cmdlets have complete help but instead of comment based help, I am using a MAML-based XML file. I created the file with an early version of SAPIEN's PowerShell Help Writer.

Because I like to think the module contains some good examples of using Invoke-Webrequest and working with XML documents, I have published the module to Github. I hope you'll give it a try and let me know what you think. At some point I might even publish it to the Microsoft PowerShell Gallery.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

1 thought on “What’s the Weather?”

  1. jrv says:
    September 29, 2015 at 2:38 pm

    Very nice.

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d