Sha256: 859d67ffff646d87b04f9832a17c493e66405bbc788b808846ba75cf76ea11f8

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

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

Import-Module Uplift.Core

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

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

    Node localhost {

        SqlServerMemory SQLServerMaxMemory
        {
            ServerName      = $Node.ServerName
            InstanceName    = $Node.InstanceName

            DynamicAlloc    = $false

            MinMemory       = $Node.MinMemory
            MaxMemory       = $Node.MaxMemory
        }
    }
}

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

            RetryCount = 10           
            RetryIntervalSec = 30

            ServerName    = Get-UpliftEnvVariable "UPLF_SQL_SERVER_NAME" "" (hostname)
            InstanceName  = Get-UpliftEnvVariable "UPLF_SQL_INSTNCE_NAME" "" "MSSQL"

            MinMemory    = Get-UpliftEnvVariable "UPLF_SQL_MIN_MEMORY" "" 1024
            MaxMemory    = Get-UpliftEnvVariable "UPLF_SQL_MAX_MEMORY" "" 4096
        }
    )
}

$configuration = Get-Command Optimize_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.optimize.dsc.ps1
vagrant-uplift-0.2.1902.18 lib/scripts/vagrant/uplift.vagrant.sql12/sql.optimize.dsc.ps1