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.

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.

Share this:

  • Print (Opens in new window) Print

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.

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

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