bin/deploy.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[CmdletBinding()]
Param (
    [string]$SqlInstance,
    [string]$Database,
    [ValidateSet('SingleTransaction', 'TransactionPerScript', 'NoTransaction')]
    [string]$DeploymentMethod = 'NoTransaction',
    [int]$ConnectionTimeout,
    [switch]$Encrypt,
    [pscredential]$Credential,
    [string]$UserName,
    [securestring]$Password,
    [string]$LogToTable,
    [switch]$Silent,
    [hashtable]$Variables
)

#Stop on error
#$ErrorActionPreference = 'Stop'

#Import module
If (Get-Module dbops) {
    Remove-Module dbops
}
Import-Module "$PSScriptRoot\Modules\dbops\dbops.psd1" -Force

#Invoke deployment using current parameters
$params = $PSBoundParameters
$params += @{ PackageFile = "$PSScriptRoot\dbops.package.json"}
Invoke-DBODeployment @params