Building the Membership PowerShell Provider

This section describes how to run the psake build of the Membership PowerShell Provider.

Prerequisites

This project uses psake 4.0 to drive the build process. You can learn more about psake at the psake GitHub project area.
You will also need PowerShell v2.0, available as part of WinRM 2.0 download from Microsoft.

Running the Build

The psake build script is located in the default.ps1 PowerShell script file, located in the root of the project source tree.

Before you can execute the build, you will need to:
  • open a PowerShell console
  • change the location to the project hive
  • import the psake module

The default build task will do the following:
  • build the provider library
  • assemble the PowerShell Membership module
  • install the Membership module to your local modules path

To execute the default build tasks, simply use the invoke-psake cmdlet with no parameters:
PS> invoke-psake

Executing task: __VerifyConfiguration
Executing task: Uninstall
Executing task: Build
Microsoft (R) Build Engine Version 3.5.30729.4926
[Microsoft .NET Framework, Version 2.0.50727.4927]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 7/27/2010 6:41:51 AM.
Project "C:\Users\beefarino\Documents\Project\ASPNETMembership\membership\src\A
SPNETMembership\ASPNETMembership.csproj" on node 0 (Build target(s)).
  Processing 0 EDMX files.
  Finished processing 0 EDMX files.
...

Build Tasks

You can also run specific build tasks individually by passing their names to invoke-psake. For a list of all available tasks, use the -docs parameter on the invoke-psake cmdlet:
PS> invoke-psake -docs

Name                     Description
----                     -----------
__CreatePackageDirectory
__VerifyConfiguration
All
Build
Clean
Install
Package
Rebuild
Test
Uninstall

Convention on this project is to name private tasks starting with an underscore.

Running Tests

The psake build script contains a Test task, which will execute a series of unit tests against the Membership PowerShell provider to verify basic functionality.
To run correctly, this task requires that a SQL-backed Membership store be available, and that a connection string to said store be passed to the build:
PS> $cxn = 'DataSource=MyMembershipStore...'
PS> invoke-psake -task Test -prop @{ connectionString=$cxn }

Last edited Jul 27, 2010 at 11:11 AM by beefarino, version 3

Comments

No comments yet.