Skip to content
thomasvm edited this page Jan 30, 2013 · 2 revisions

Installation

There are two ways of installing Unfold

1. In user profile

The recommended way is to install Unfold in your user profile. Once this is done, you can add the scripts needed for deployment by executing the following PowerShell command:

Install-Unfold

This will add a folder called deployment containing two files:

  1. deploy.ps1: the file that holds your deployment steps and configuration
  2. unfold.ps1: a launcher script that will load the unfold module from your profile and executed the deployment script

2. Locally inside your project

Alternatively you can also install Unfold locally inside the project you want to deploy. To do so: open the Visual Studio Package Manager Console and type

Install-Package unfold

Preferrably inside a web project, but this is not required. This creates a deployment folder in your project containing:

  • a local copy of the unfold powershell library
  • an unfold.ps1 launcher script that can be used to launch deployment commands
  • the most important file: deploy.ps1, containing configuration settings and deployment tasks for your project

Quickstart

Now that unfold is in your project:

  1. open the deploy.ps1 file, it contains both the configuration values and custom tasks for your project. This is what you customize. Note that Visual Studio by default does not have support for PowerShell syntax highlighting, you might want to open the file in another editor or consider installing PowerGUI extensions or TextHighlighterExtensionSetup. Or you could simply use any other code editor.

  2. have a look at the examples

  3. Open a powershell command-line into the deployment folder and execute (or change the directory of the Package Manager Console to the deployment folder)

        .\unfold.ps1 deploy
  4. check the output and adjust the configuration as needed

  5. customize your deployment by writing custom tasks to the deploy.ps1 file


Usage

Executing Unfold happens through the unfold.ps1 script. The following options are available

  1. Executing a target, the default target (if any) is defined in your deploy.ps1 script

     .\unfold.ps1 deploy
    
  2. For a list of all available tasks, you can pass in the -docs switch

     .\unfold.ps1 -docs
    
  3. Some tasks can have parameters (e.g. rollback) these are passed in using the -properties parameter, combined with a hashtable

     .\unfold.ps1 rollback -properties @{to=5} -on production