Get-Weather

Get-Weather

  • Comments 2

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

Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post
  • For those users behind a proxy, you'll need to add a few lines after the $webclient initialization line:

       $proxy = New-Object System.Net.WebProxy "MyProxyServer:MyProxyPort"

       $proxy.UseDefaultCredentials = $true

       $webclient.proxy = $proxy

    You'll need to replace MyProxyServer and MyProxyPort with the appropriate values for your proxy server (found easily in IE under Options\Connections\Lan Settings)

    Thanks for another great find Jeff!

  • That was an awsome presentation on Friday!  Especially showing us the get-weather cmdlt.

    Thanks Jeff!!!!!

Page 1 of 1 (2 items)