Skip to content
rprieto edited this page Sep 14, 2010 · 32 revisions

Intro

Welcome to psDeploy, a deployment automation library for Powershell. This small-footprint package provides additional cmdlets for common interaction with Windows during deployment processes.

Adding the psDeploy module to your development / test / production servers allows you to automate the teardown or setup of your environments, thus limiting the need for manual configuration and documentation.

The cmdlets are grouped into 2 categories:

How to use psDeploy

  1. Install Powershell 2.0 if necessary, from http://support.microsoft.com/kb/968929
  2. Download the ZIP file using the link at the top right
  3. Extract it to any of the powershell module paths, which you can list by running “env:psmodulepath”
  4. Add the following lines at the top of your script:
Import-Module psDeploy
Assert-PsDeploySupported

Additional notes

The commandlets will usually have one of the following outcome:

  • Be successful and print a success message, for ex. Created new user 'Bill'
  • Print a message if no action was taken, for ex. The app pool 'MyWeb' was already stopped
  • Throw an exception detailing the reason of the failure

Is is recommended to log the output of the deployments scripts for inspection or archive purposes.
This can easily be done by wrapping the whole script between:

$date = Get-Date -Format "yyyy-MM-dd-hh\hmm\mss\s"
Start-Transcript -Path "C:\DeploymentLogs\$date.log"

# Insert your script here

Stop-Transcript
Clone this wiki locally