Sha256: a2d79df3aa6451d2a5b109436c65b057e10907d589e34679ef79f98b26bdf28c

Contents?: true

Size: 1.96 KB

Versions: 2

Compression:

Stored size: 1.96 KB

Contents


# https://docs.microsoft.com/en-us/sql/database-engine/install-windows/considerations-for-installing-sql-server-using-sysprep?view=sql-server-2017
# https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-using-sysprep?view=sql-server-2017
# Setup.exe /q /ACTION=PrepareImage l /FEATURES=SQLEngine /InstanceID =<MYINST> /IACCEPTSQLSERVERLICENSETERMS

# SqlSetup: Add support for sysprepped SQL Server. #2
# https://github.com/PowerShell/SqlServerDsc/issues/2#event-1399718765

# 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"

Write-UpliftMessage "Executing prepare DSC..."
Configuration Prepare_SQL
{
    Import-DscResource -ModuleName xSQLServer

    Node localhost {

        LocalConfigurationManager
        {
            RebootNodeIfNeeded = $false
        }

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

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

# Setup.exe /q /ACTION=PrepareImage /FEATURES=SQLEngine /InstanceID =<MYINST> /IACCEPTSQLSERVERLICENSETERMS
$execPath       = "$binSourcePath/setup.exe"
$execArguments  = "/qs /ACTION=PrepareImage /FEATURES=$instanceFeatures /InstanceID=$instanceName /IACCEPTSQLSERVERLICENSETERMS"

Write-UpliftMessage "Executing prepare action..."
Write-UpliftMessage " - execPath:      $execPath"
Write-UpliftMessage " - execArguments: $execArguments"

$process = Start-Process -FilePath $execPath `
            -ArgumentList "$execArguments" `
            -Wait `
            -PassThru

$exitCode = $process.ExitCode;
Write-Host "Exit code was: $exitCode"

exit $exitCode

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.prepare.dsc.ps1
vagrant-uplift-0.2.1902.18 lib/scripts/vagrant/uplift.vagrant.sql12/sql.prepare.dsc.ps1