Trevor Sullivan's Tech Room

Minding the gap between administration and development

Posts Tagged ‘api’

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 "http://api.search.live.net/search.wsdl?AppID=$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:

Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxyXXXXXXXXXXXXXXXXXXXXXXXXXXX.SearchRequest

Read the rest of this entry »

Advertisements

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

ConfigMgr 2012: Deleting Advertisements

Posted by Trevor Sullivan on 2011/07/06


Where’d my Advertisements Go?

Advertisements aren’t quite what you think they are. At least, that’s probably the case if you’re talking in context of Microsoft System Center Configuration Manager (SCCM / ConfigMgr). At first glance you might see “deleting advertisements” and exclaim: “YES! Please do!” The difference here is that advertisements in SCCM are not product or service advertisements, but rather proclamations of the availability of software to a computer system. If you’re reading this, you most likely already knew that, but if not, then … now you do.

Back in the days of the SCCM 2007 console, there was a single Software Distribution –> Advertisements node which contained advertisements for both standard software distribution and operating system deployment (OSD) task sequences. This worked pretty well, but it was a little confusing since the operating system deployment node was entirely separate from software distribution. Hierarchically, it just didn’t make sense.

image

Read the rest of this entry »

Posted in configmgr, ConfigMgr vNext | Tagged: , , , , , , , , , , , , , , , , | Leave a Comment »

Windows API Code Pack

Posted by Trevor Sullivan on 2010/04/06


There is some free code available on the MSDN Code Gallery, called the Windows API Code Pack for Microsoft .NET Framework, which enables .NET developers to access certain Windows 7 features that are not typically available via the .NET Base Class Library (BCL). Naturally, since this is .NET code, the same functionality ought to be available to PowerShell users!

Get it here: http://code.msdn.microsoft.com/WindowsAPICodePack

Among the feature set is:

  • Windows 7 Taskbar – Jump lists, icon overlay, progress bar, tabbed thumbnails, and thumbnail toolbars
  • Windows Shell
  • DirectX
  • Power Management APIs
  • Application Restart and Recovery APIs
  • … and much more!

Hope this helps!

Posted in powershell, scripting, tools | Tagged: , , , , , | Leave a Comment »