[wix-users] Excuting Powershell cmdlets in installers

John Zajac jzajac2 at gmail.com
Thu May 19 09:22:09 PDT 2016


As part of a WiX installer project, I need to do things like:

   - create send connectors (New-SendConnector)
   - receive connector (New-ReceiveConnector)
   - Install transport agents (Install-TransportAgent)


and it appears Microsoft's only (officially documented) way to do this is
through powershell - I can't seem to find a more direct .net API way of
doing this
<http://stackoverflow.com/questions/37217447/is-there-a-managed-api-i-can-use-create-exchange-2010-2013-send-connectors-o>
.
(if anyone does know of a way correct me, I haven't poked around the
Exchange assemblies I was hoping for something documented/recommended by
Microsoft)

I've been on the interweb surveying how others have done this. Some of
which don't feel right (having the scripts in your installer and shelling
out to powershell.exe.., for example). I prefer taking an approach of
spinning up a runspace like this PowerShellWixExtension
<https://github.com/flcdrg/PowerShellWixExtension>.

*My question is: *are there any plans for the WiX toolset to bring in more
formal support for Powershell custom actions, such as an extension?

Or, is running powershell cmdlets in an installer a bad route to take, in
general (even if wrapped in DTF custom action)?


More information about the wix-users mailing list