Trevor Sullivan's Tech Room

Minding the gap between administration and development

Posts Tagged ‘new-webserviceproxy’

PowerShell: Shortening Web Service Type Names with a Hashtable

Posted by Trevor Sullivan on 2011/07/13

When you use the New-WebServiceProxy class, you probably have noticed that PowerShell dynamically generates some really ugly type names. For example, if we get a reference to the Bing web service (you’ll need to get an API key first):

$BingSearch = New-WebServiceProxy -Class BingSearch -Uri "$ApiKey"

… and examine the types contained within it:

$BingSearch.GetType().Assembly.GetExportedTypes() | select FullName

… you’ll notice some ridiculously long type names based on your API key, such as:


Read the rest of this entry »


Posted in powershell, scripting | Tagged: , , , , , , , , , , , , , , , , | 2 Comments »