March 14th, 2007

Introducing Windows Installer PowerShell Extensions

Heath Stewart
Principal Software Engineer

Some time back I mentioned in a comment I was working on some PowerShell extensions for Windows Installer. Actually, it was a long time ago and I’ve spent more time learning the “ins” and “outs” of PowerShell (mostly the “ins” using .NET Reflector because the documentation needs work) than actually writing anything. Then, of course, there was that little Visual Studio 2005 Service Pack 1 project.

While I am still busy working on things for future releases out of Developer Division and beyond, I want to make this project available and add features to it over time. So, I introduce to you the Windows Installer PowerShell Extensions project on CodePlex. There is no installation package yet as I explore better alternatives to running installutil.exe or implementing similar functionality for use in an in-process custom action, but you can download what I have today and install it yourself using installutil.exe. After installed, start PowerShell and execute the following:

add-pssnapin psmsi

There are two cmdlets currently provided for enumerating installed and advertised product information, and for enumerating applied, superseded, and obsolesced patch information. I have posted some examples and will add more over time. For example, to get the sizes of all applied, superseded, and obsolesced patches, execute the following:

get-msipatchinfo -filter all | get-itemproperty | format-table fullname, lastwritetime, length -autosize

I’d also like to shout out my appreciation to Sara Ford for helping expedite the process of getting this project published on CodePlex.

Author

Heath Stewart
Principal Software Engineer

Heath is an application architect and developer, looking to help educate others to learn professional development. Besides designing and developing applications he enjoys writing about intermediate and advanced topics. Heath also consults for deployment packages and scenarios within Microsoft and for external customers.

0 comments

Discussion are closed.