Getting US ZIP Codes

by Oct 13, 2014

All PowerShell Versions

Ever wanted to find out the ZIP code of a city, or vice versa find out the city that belongs to a ZIP code?

Then simply ask PowerShell to connect to a free web service and get that information for you:

$webservice = New-WebServiceProxy -Uri 'http://www.webservicex.net/uszip.asmx?WSDL'
$webservice.GetInfoByCity('New York').Table
$webservice.GetInfoByZIP('10286').Table 

Twitter This Tip! ReTweet this Tip!