vswhere now searches older versions of Visual Studio

One of the top requests I kept hearing for vswhere was to also search older versions of Visual Studio. You can now do that starting with the latest release. Even if you don’t have Visual Studio 2017 or newer installed – which means the query API is not even registered – you can use vswhere… Read more

Visual Studio Setup PowerShell Module Available

To make the new setup configuration APIs more accessible to developers, we have published the “VSSetup” PowerShell module on powershellgallery.com, making it quick and easy to install. If you have Windows Management Framework (WMF) 5.0 or newer – installed with Windows 10 – or PowerShellGet for PowerShell 3.0 or 4.0, you can run the following… Read more

Get the Windows Installer PowerShell Module easier with WMF 5.0

Many years ago when PowerShell was first in beta, I saw an opportunity to write cmdlets that I could string together in different ways rather than writing and maintaining a bunch of one-off Windows scripts for various day-to-day tasks and customer diagnostics. I created the Windows Installer PowerShell Module to fill that role. These cmdlets… Read more

Seeing colors with psake

Psake (pronounced like Japanese “sake”) is a build automation tool similar to others out there like make, rake, etc., but built using PowerShell as the language of choice. So it should be no surprise that I use it for my Windows Installer PowerShell Module. It’s useful for automating tasks not limited to just calling MSBuild,… Read more

How to relocate the Package Cache

Visual Studio can require a lot of space on the system drive. Based on years of data collected from customers’ installations from the Customer Experience Improvement Program, we took advantage of this feature in Burn – the Windows Installer XML (WiX) chainer – to eliminate most errors during repair, servicing, and even uninstall. This was… Read more

Windows Installer PowerShell Module 2.2.1 Released

Yesterday I released servicing update 2.2.1, which updates 2.2.0 to fix a few bugs and add a few cool new features: You can define the [string] $MsiAttributeColumnFormat variable to dictate how attribute columns should appear. The values you can pass are the same as the enumeration format strings, except that “G” displays the culture-invariant decimal… Read more

Functional Testing of Cmdlets

While developing unit and functional tests for Windows Installer PowerShell Extensions, I needed a way to invoke cmdlets without requiring elevation on Vista. That is, of course, because running elevated has always been a bad idea unless it is required. In order to load a PowerShell snap-in, however, one must write to HKEY_LOCAL_MACHINE which requires… Read more

Group by Different Properties for Format-Table

For my Windows Installer PowerShell Extensions, I’ve been simplifying some of the use cases and adding additional formats. One thing I wanted to do was display source list information in a table and group either by the attached ProductCode or PatchCode properties. The format-table cmdlet doesn’t support multiple properties and doesn’t appear to allow you… Read more

Get Binder Variables for Assemblies without Installing into the GAC

Binder variables in WiX are variables that are resolved, coincidentally, at bind time. This is when the linker, light.exe, collects file information, assigns auto-GUIDs, and generates the output packages among other things. There are binder variables for all versioned binaries, and binder variables specific to both managed and native assemblies or exclusive to one or… Read more

WiX Extension for PowerShell Snap-ins

To write an installer for your PowerShell snap-in, the PowerShell documentation instructs you to extend the PSSnapIn or CustomPSSnapIn class. When you add your snap-in assembly to the Custom Action view in a Windows Installer Project in Visual Studio, the InstallerClass property should be set to True and your installer class will be run when… Read more