Sha256: ba8fa8c3398aa7a12386d3dd75d939f1c2a74678d2959d424c240a530f7d9901

Contents?: true

Size: 1.72 KB

Versions: 2

Compression:

Stored size: 1.72 KB

Contents

# fail on errors and include uplift helpers
$ErrorActionPreference = "Stop"

Import-Module Uplift.Core

Write-UpliftMessage "Installing SQL Server..."
Write-UpliftEnv

$binSourcePath       = Get-UpliftEnvVariable "UPLF_SQL_BIN_PATH"
$instanceName        = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_NAME"
$instanceFeatures    = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_FEATURES"
$sqlSysAdminAccounts = (Get-UpliftEnvVariable "UPLF_SQL_SYS_ADMIN_ACCOUNTS").Split(',')

Configuration Install_SQL
{
    Import-DscResource -ModuleName 'xSQLServer'
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'

    Node localhost {

        LocalConfigurationManager 
        {
            RebootNodeIfNeeded = $false
        }

        WindowsFeature "NET-Framework-Core" 
        {
            Ensure = "Present"
            Name   = "NET-Framework-Core"
        }

        xSqlServerSetup "SQL"
        {
            DependsOn           = "[WindowsFeature]NET-Framework-Core"
            SourcePath          = $Node.BinSourcePath
            InstanceName        = $Node.InstanceName
            Features            = $Node.InstanceFeatures
            SQLSysAdminAccounts = $Node.SqlSysAdminAccounts
        }
    }

}

$config = @{
    AllNodes = @(
        @{
            NodeName = 'localhost'
            PSDscAllowPlainTextPassword = $true

            RetryCount = 10           
            RetryIntervalSec = 30

            BinSourcePath       = $binSourcePath

            InstanceName        = $instanceName
            InstanceFeatures    = $instanceFeatures
            
            SqlSysAdminAccounts = $sqlSysAdminAccounts
        }
    )
}

$configuration = Get-Command Install_SQL
Start-UpliftDSCConfiguration $configuration $config 

exit 0

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-uplift-0.2.1902.19 lib/scripts/vagrant/uplift.vagrant.sql12/sql.dsc.ps1
vagrant-uplift-0.2.1902.18 lib/scripts/vagrant/uplift.vagrant.sql12/sql.dsc.ps1