Getting Holiday Dates

by Apr 19, 2013

Ed Wilson from the Scripting Guys demonstrated how PowerShell can use free web services to find out holidays. You do need direct (non-proxy) Internet access for this to work.

This is how you connect to the holiday web service:

$URI = "http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx"
$proxy = New-WebServiceProxy -Uri $URI -Class holiday -Namespace webservice

Next, you can use the methods provided by the web service. This gets you the list of countries that the web service supports:

To list all holidays in the United States, use GetHolidaysAvailable():

And if you'd like to know just what date Groundhog Day is next year, use GetHolidayDate() and submit the holiday code you got from GetHolidaysAvailable(), plus the year you are interested in:

Twitter This Tip! ReTweet this Tip!