RunTime Options
Once you open
Start-Sql.ps1 in PowerShell ISE. There are a myriad of options you
can configure, but only a few you
mustThe $ht object is a hashtable, it is a simply key/value pair collection that is pass directly into the Install Process.
The values for DataCenter, SqlVersion and SqlEdition will be validated against what you have setup in the respective sections of the
Config File Setup, thus ensure those are valid against your Config.
#Required Parameters
$ht.Add("DataCenter", 'Data Center 1')
$ht.Add("SqlVersion", 'Sql2012')
$ht.Add("SqlEdition", 'Developer')
The only other
REQUIRED parameter is the SA password, which unfortunately is pass in plain text.
$ht.Add("SysAdminPassword", 'SQL4tw!')
Service Accounts
Service Accounts and respective passwords can be set, otherwise will default, As defined by Microsoft
https://msdn.microsoft.com/en-us/library/ms143504.aspx Other account types to Come
$ht.Add("sqlServiceAccount", 'SQLFTW\SQLService')
$ht.Add("sqlServicePassword", 'SQL4tw!')
$ht.Add("isServiceAccount", 'SQLFTW\SQLService')
$ht.Add("isServicePassword", 'SQL4tw!')
$ht.Add("agtServiceAccount", 'SQLFTW\SQLService')
$ht.Add("agtServicePassword", 'SQL4tw!')
$ht.Add("ftServiceAccount", 'SQLFTW\SQLService')
$ht.Add("ftServicePassword", 'SQL4tw!')
Other optional, regularly used parameters:
- InstanceName - Will default to no instance if not provided.
- ProductStringName - This is a list of Features to Install
- Environment - Setting is not used by Install, but can be defined in Environment Nodes of Config file and later used in custom Pre/Post scripts.
Custom SQL Install Options
While your regular install options should be setup in the Version specific Configuration Template, you can override those individual features by using the $overrides hashtable in this manner:
$overrides.Add("SQLBACKUPDIR", 'C:\$Recycle.Bin')
$overrides.Add("SQLUSERDBDIR", 'H:\MSSQL10\MSSQL\Data')
$overrides.Add("SQLUSERDBLOGDIR", 'H:\MSSQL10\MSSQL\Logs')
Script Control and Output
Debug
Debug can be initiated in one of two ways:
Add the Parameter:
$ht.Add("Debug", 'True')
Or simply pass the -Debug parameter directly to the Run-Install Command
Run-Install -Parameters $ht -TemplateOverrides $overrides -Verbose -Full -Debug
Simulation
Just as debug, a simulated/whatif execution can be initiated in one of two ways:
Add the Parameter:
$ht.Add("Simulation", 'True')
Or simply pass the -WhatIf parameter directly to the Run-Install Command
Run-Install -Parameters $ht -TemplateOverrides $overrides -Verbose -Full -WhatIf