PowerShellWixExtension 3.0.4

There is a newer 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.4
                    
NuGet\Install-Package PowerShellWixExtension -Version 3.0.4
                    
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.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PowerShellWixExtension" Version="3.0.4" />
                    
Directory.Packages.props
<PackageReference Include="PowerShellWixExtension" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PowerShellWixExtension --version 3.0.4
                    
#r "nuget: PowerShellWixExtension, 3.0.4"
                    
#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.
#addin nuget:?package=PowerShellWixExtension&version=3.0.4
                    
Install as a Cake Addin
#tool nuget:?package=PowerShellWixExtension&version=3.0.4
                    
Install as a Cake Tool

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

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0-beta.12 648 4/5/2021
3.0.6 5,179 4/25/2024
3.0.4 132 4/25/2024
3.0.2 133 4/25/2024
2.0.1 43,946 4/4/2017
2.0.0-beta2 1,075 5/16/2016
2.0.0-beta1 1,004 5/15/2016
1.9.0 27,138 8/26/2014
1.8.0 1,874 8/18/2014
1.7.0 1,365 7/18/2014
1.6.0 1,326 7/17/2014
1.5.0 1,471 6/23/2014
1.4.0 1,373 6/6/2014
1.3.0 1,361 6/5/2014
1.2.0 1,401 5/29/2014
1.1.0 1,392 5/28/2014

## What’s Changed

* Add README to nuspec (#56) @flcdrg