PowerShellWixExtension 3.0.6

There is a newer prerelease version of this package available.
See the version list below for details.

Requires NuGet 2.7 or higher.

dotnet add package PowerShellWixExtension --version 3.0.6
NuGet\Install-Package PowerShellWixExtension -Version 3.0.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PowerShellWixExtension" Version="3.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PowerShellWixExtension --version 3.0.6
#r "nuget: PowerShellWixExtension, 3.0.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PowerShellWixExtension as a Cake Addin
#addin nuget:?package=PowerShellWixExtension&version=3.0.6

// Install PowerShellWixExtension as a Cake Tool
#tool nuget:?package=PowerShellWixExtension&version=3.0.6

PowerShellWixExtension

A Wix Extension for running PowerShell scripts

NuGet Package

NuGet AppVeyor

All ready to add to an existing Wix project. Grab the latest version from https://www.nuget.org/packages/PowerShellWixExtension/

Getting Started

  1. Add a reference to the PowerShellWixExtension.dll in your Wix Setup Project (NuGet package recommended)
  2. Add namespace to .wxs file
    <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:powershell="http://schemas.gardiner.net.au/PowerShellWixExtensionSchema">
  1. To execute a .ps1 file that ships with the project
   <powershell:File Id="PSFile1" File="[#TestPs1]" Arguments="&quot;First Argument&quot; 2"/>
  1. To execute inline script use
    <powershell:Script Id="Script2">
      <![CDATA[
        # Write-Host "Number 2";

        for ($i = 1; $i -le 100; $i++) 
        {
          Write-Progress -Activity "Activity" -Status "Status $i% complete" -CurrentOperation "Operation $i" -PercentComplete $i
          Start-Sleep -Milliseconds 5 
        }

        ]]>
    </powershell:Script>

Notes

Custom sequences

You can customise when a set of scripts are run by adding your own <Custom /> element inside your <InstallExecuteSequence /> element. eg.

      <InstallExecuteSequence>
        <Custom Action="PowerShellScriptsDeferred" After="RegisterUser">NOT Installed</Custom>
      </InstallExecuteSequence>

The four defined actions are:

  1. PowerShellScriptsDeferred
  2. PowerShellScriptsElevatedDeferred
  3. PowerShellFilesDeferred
  4. PowerShellFilesElevatedDeferred

Inline Scripts

  • Be aware that if your inline script uses square brackets [ ], you'll need to escape them like [\[] [\]] otherwise they will be interpreted as MSI properties (unless that is what you wanted!)
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on PowerShellWixExtension:

Repository Stars
tableau/TabMon
A Tableau Server performance monitoring service
Version Downloads Last updated
4.0.0-beta.12 473 4/5/2021
3.0.6 36 4/25/2024
3.0.4 21 4/25/2024
3.0.2 20 4/25/2024
2.0.1 37,970 4/4/2017
2.0.0-beta2 863 5/16/2016
2.0.0-beta1 797 5/15/2016
1.9.0 26,377 8/26/2014
1.8.0 1,272 8/18/2014
1.7.0 1,138 7/18/2014
1.6.0 1,103 7/17/2014
1.5.0 1,242 6/23/2014
1.4.0 1,146 6/6/2014
1.3.0 1,132 6/5/2014
1.2.0 1,169 5/29/2014
1.1.0 1,151 5/28/2014

## What’s Changed

* Fix bracket formatting (#57) @flcdrg