December 8th, 2006

Get-Weather

PowerShell Team
PowerShell Team

Jeffery Hicks has a very cool blog entry where he defines a Get-Weather script which downloads the weather from yahoo.com, casts the results to XML and then reports the weather using the Speech object.  It’s totally cool.  I’m going to show it off today during my demo. 

I’m down in LA meeting with MySpace and getting a tour of the operations and seeing how they use PowerShell to manage their production servers.  I get to do a demo at their Friday “Dojo” meeting (Pizza and presentation).  As a kid, I used to go to “old-school” Uechi-Ryu Dojo where they used to hit us while doing katas (sometimes with baseball bats!) to ensure that we were focusing our minds.  – I’m hoping this Dojo is a little gentler than that. 🙂

 I’m going to tweak Jeffery’s script to make it my own.  I’m going the default ZIP code and temp scale and then use a HERE string and make one call to Speak().  There is no good reason for this other than style and the fact that I just absolutely love here strings. 

Enjoy!

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Category
PowerShell

Author

PowerShell Team
PowerShell Team

PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.

0 comments

Discussion are closed.