Database packaging and Powershell scripts

Automated deployment for web applications and databases

Database packaging and Powershell scripts

Postby » Thu Jun 27, 2013 9:41 pm

The new SSMS add-in with DM 2.0 allows me to generate a quick database pkg for a chosen database, but how am I to add in any powershell scripts? What am i missing?
Posts: 12
Joined: Thu Jun 27, 2013 9:23 pm
Location: Boston

Postby justin.caldicott » Fri Jun 28, 2013 12:07 pm

Hi Jeff,

What actions are you looking to perform with the PowerShell, over the built-in deployment logic? Do they need access to the extracted database scripts?

If not, then you can package up some custom PowerShell using RgPublish, and add that as a step, that can be reused as needed.

If they do need access to the database scripts, then this would need to be done using the sqlCI command line tool / build scripts, that are part of the automation pack we mentioned: ... tion-pack/

Using custom PowerShell that has access to the database scripts is not possible from the SSMS add-in yet. It's something on our list to address. How big of an issue is this for you?


Justin Caldicott
Redgate Software Ltd
Posts: 57
Joined: Wed Apr 20, 2011 4:42 pm

RgPublish and powershell with database packaging

Postby » Wed Jul 03, 2013 12:31 pm

I won't need access to the sql scripts for database deployment. However, since database deployment is done first, I'd still need to do safety tasks like backing up some databases, turning off the application, and so on. What is the best way here? I was thinking I could create my own package with just powershell scripts to do the database backups, and turn off the app, call it "preliminaries" before any other step runs...

I don't see a way to add my powershell to the database pkg. Not sure it would help.
Posts: 12
Joined: Thu Jun 27, 2013 9:23 pm
Location: Boston

Postby james.billings » Thu Jul 04, 2013 8:31 am

You could create a Deploy.ps1 in a folder of it's own that would perform any extra steps you need, use RGPublish to package that up, then add it to your release as a step before the database deployment step?
Posts: 1122
Joined: Wed Jun 16, 2010 10:10 am
Location: Red Gate

Return to Deployment Manager

Who is online

Users browsing this forum: No registered users and 0 guests