Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5df11d2

Browse files
committedMay 25, 2017
Updated sql doc stuff
1 parent 1ee54b3 commit 5df11d2

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed
 

‎DSC/SQLServer/SQLServerStandalone.ps1

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@
33
Configuration SQLStandalone
44
{
55
param(
6-
[pscredential]$SetupCredential ## Need to pass a credential for setup
6+
[Parameter(Mandatory)]
7+
[ValidateNotNullOrEmpty()]
8+
[pscredential]$SetupCredential,
9+
10+
[Parameter(Mandatory)]
11+
[ValidateNotNullOrEmpty()]
12+
[ValidatePattern('sxs$')]
13+
[string]$WindowsServerSource,
14+
15+
[Parameter(Mandatory)]
16+
[ValidateNotNullOrEmpty()]
17+
[string]$SqlServerInstallSource,
18+
19+
[Parameter(Mandatory)]
20+
[ValidateNotNullOrEmpty()]
21+
[string]$SysAdminAccount
722
)
823
## Download the xSQLServer module from the PowerShell Gallery
924
Import-DscResource -Module xSQLServer
@@ -16,26 +31,26 @@ Configuration SQLStandalone
1631
{
1732
Ensure = "Present"
1833
Name = "NET-Framework-Core"
19-
Source = "\MEMBERSRV1InstallersWindowsServer2012R2sourcessxs"
34+
Source = $WindowsServerSource
2035
}
2136

2237
## Have DSC grab install bits from the SourcePath, install under the instance name with the features
2338
## using the specified SQL Sys admin accounts. Be sure to install the Windows feature first.
2439
xSqlServerSetup 'SqlServerSetup'
2540
{
2641
DependsOn = "[WindowsFeature]NET-Framework-Core"
27-
SourcePath = '\MEMBERSRV1InstallersSqlServer2016'
42+
SourcePath = $SqlServerInstallSource
2843
SetupCredential = $SetupCredential
2944
InstanceName = 'MSSQLSERVER'
3045
Features = 'SQLENGINE,FULLTEXT,RS,AS,IS'
31-
SQLSysAdminAccounts = 'mylab.localAdministrator'
46+
SQLSysAdminAccounts = $SysAdminAccount
3247
}
3348

3449
## Add firewall exceptions for SQL Server but run SQL server setup first.
3550
xSqlServerFirewall 'SqlFirewall'
3651
{
3752
DependsOn = '[xSqlServerSetup]SqlServerSetup'
38-
SourcePath = '\MEMBERSRV1InstallersSqlServer2016'
53+
SourcePath = $SqlServerInstallSource
3954
InstanceName = 'MSSQLSERVER'
4055
Features = 'SQLENGINE,FULLTEXT,RS,AS,IS'
4156
}
@@ -46,5 +61,5 @@ if (-not (Get-Module -Name xSqlServer -ListAvailable)) {
4661
Install-Module -Name 'xSqlServer' -Confirm:$false
4762
}
4863

49-
SQLStandAlone
64+
SQLStandAlone -SetupCredential (Get-Credential) -WindowServerSource '' -SqlServerInstallSource '' -SysAdminAccount '' -ConfigurationData '.\ConfiguraitonData.psd1'
5065
Start-DscConfiguration –Wait –Force –Path '.\SQLStandalone' –Verbose

0 commit comments

Comments
 (0)
Please sign in to comment.