Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlServerDsc: Add public commands for setup actions #1784

Merged
merged 42 commits into from
Nov 24, 2022

Conversation

johlju
Copy link
Member

@johlju johlju commented Aug 30, 2022

Pull Request (PR) description

  • SqlServerDsc
    • The following private functions were added to the module (see comment-based
      help for more information):
      • Assert-ElevatedUser
      • Assert-RequiredCommandParameter
      • Test-IsNumericType
      • Assert-SetupActionProperties
      • Invoke-SetupAction
    • The following public functions were added to the module (see comment-based
      help for more information):
      • Install-SqlDscServer
      • Uninstall-SqlDscServer
      • Add-SqlDscNode
      • Remove-SqlDscNode
      • Repair-SqlDscServer
      • Complete-SqlDscImage
      • Complete-SqlDscFailoverCluster
      • Initialize-SqlDscRebuildDatabase

The syntax from the commands below.

Install-SqlDscServer
NAME
    Install-SqlDscServer

SYNTAX
    Install-SqlDscServer -Install -AcceptLicensingTerms -MediaPath <string> -AzureSubscriptionId <string> -AzureResourceGroup <string> -AzureRegion
    <string> -AzureTenantId <string> -AzureServicePrincipal <string> -AzureServicePrincipalSecret <securestring> [-AzureArcProxy <string>] [-Timeout
    <uint>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-SqlDscServer -Install -AcceptLicensingTerms -MediaPath <string> -Role {ALLFeatures_WithDefaults | SPI_AS_NewFarm | SPI_AS_ExistingFarm}
    [-SuppressPrivacyStatementNotice] [-IAcknowledgeEntCalLimits] [-InstanceName <string>] [-Enu] [-UpdateEnabled] [-UpdateSource <string>]
    [-Features {SQL | SQLEngine | Replication | FullText | DQ | PolyBase | PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR |
    SQL_INST_MPY | SQL_INST_JAVA | AS | RS | RS_SHP | RS_SHPWFE | DQC | IS | IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools |
    BC | Conn | DREPLAY_CTLR | DREPLAY_CLT | SNAC_SDK | SDK | LocalDB | ARC}] [-InstallSharedDir <string>] [-InstallSharedWowDir <string>]
    [-InstanceDir <string>] [-InstanceId <string>] [-PBEngSvcAccount <string>] [-PBEngSvcPassword <securestring>] [-PBEngSvcStartupType {Automatic |
    Disabled | Manual}] [-PBDMSSvcAccount <string>] [-PBDMSSvcPassword <securestring>] [-PBDMSSvcStartupType {Automatic | Disabled | Manual}]
    [-PBStartPortRange <ushort>] [-PBEndPortRange <ushort>] [-PBScaleOut] [-ProductKey <string>] [-AgtSvcAccount <string>] [-AgtSvcPassword
    <securestring>] [-AgtSvcStartupType {Automatic | Disabled | Manual}] [-ASBackupDir <string>] [-ASCollation <string>] [-ASConfigDir <string>]
    [-ASDataDir <string>] [-ASLogDir <string>] [-ASTempDir <string>] [-ASServerMode {Multidimensional | PowerPivot | Tabular}] [-ASSvcAccount
    <string>] [-ASSvcPassword <securestring>] [-ASSvcStartupType {Automatic | Disabled | Manual}] [-ASSysAdminAccounts <string[]>]
    [-ASProviderMSOLAP] [-FarmAccount <string>] [-FarmPassword <securestring>] [-Passphrase <securestring>] [-FarmAdminiPort <ushort>]
    [-BrowserSvcStartupType {Automatic | Disabled | Manual}] [-EnableRanU] [-InstallSqlDataDir <string>] [-SqlBackupDir <string>] [-SecurityMode
    {SQL}] [-SAPwd <securestring>] [-SqlCollation <string>] [-AddCurrentUserAsSqlAdmin] [-SqlSvcAccount <string>] [-SqlSvcPassword <securestring>]
    [-SqlSvcStartupType {Automatic | Disabled | Manual}] [-SqlSysAdminAccounts <string[]>] [-SqlTempDbDir <string>] [-SqlTempDbLogDir <string>]
    [-SqlTempDbFileCount <ushort>] [-SqlTempDbFileSize <ushort>] [-SqlTempDbFileGrowth <ushort>] [-SqlTempDbLogFileSize <ushort>]
    [-SqlTempDbLogFileGrowth <ushort>] [-SqlUserDbDir <string>] [-SqlSvcInstantFileInit] [-SqlUserDbLogDir <string>] [-SqlMaxDop <ushort>]
    [-UseSqlRecommendedMemoryLimits] [-SqlMinMemory <uint>] [-SqlMaxMemory <uint>] [-FileStreamLevel <ushort>] [-FileStreamShareName <string>]
    [-ISSvcAccount <string>] [-ISSvcPassword <securestring>] [-ISSvcStartupType {Automatic | Disabled | Manual}] [-NpEnabled] [-TcpEnabled]
    [-RsInstallMode {SharePointFilesOnlyMode | DefaultNativeMode | FilesOnlyMode}] [-RSSvcAccount <string>] [-RSSvcPassword <securestring>]
    [-RSSvcStartupType {Automatic | Disabled | Manual}] [-MPYCacheDirectory <string>] [-MRCacheDirectory <string>] [-SqlInstJava] [-SqlJavaDir
    <string>] [-AzureSubscriptionId <string>] [-AzureResourceGroup <string>] [-AzureRegion <string>] [-AzureTenantId <string>]
    [-AzureServicePrincipal <string>] [-AzureServicePrincipalSecret <securestring>] [-AzureArcProxy <string>] [-SkipRules <string[]>] [-Timeout
    <uint>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-SqlDscServer -Install -AcceptLicensingTerms -MediaPath <string> -InstanceName <string> -Features {SQL | SQLEngine | Replication |
    FullText | DQ | PolyBase | PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR | SQL_INST_MPY | SQL_INST_JAVA | AS | RS | RS_SHP |
    RS_SHPWFE | DQC | IS | IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools | BC | Conn | DREPLAY_CTLR | DREPLAY_CLT | SNAC_SDK
    | SDK | LocalDB | ARC} -SqlSysAdminAccounts <string[]> [-SuppressPrivacyStatementNotice] [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled]
    [-UpdateSource <string>] [-InstallSharedDir <string>] [-InstallSharedWowDir <string>] [-InstanceDir <string>] [-InstanceId <string>]
    [-PBEngSvcAccount <string>] [-PBEngSvcPassword <securestring>] [-PBEngSvcStartupType {Automatic | Disabled | Manual}] [-PBDMSSvcAccount
    <string>] [-PBDMSSvcPassword <securestring>] [-PBDMSSvcStartupType {Automatic | Disabled | Manual}] [-PBStartPortRange <ushort>]
    [-PBEndPortRange <ushort>] [-PBScaleOut] [-ProductKey <string>] [-AgtSvcAccount <string>] [-AgtSvcPassword <securestring>] [-AgtSvcStartupType
    {Automatic | Disabled | Manual}] [-ASBackupDir <string>] [-ASCollation <string>] [-ASConfigDir <string>] [-ASDataDir <string>] [-ASLogDir
    <string>] [-ASTempDir <string>] [-ASServerMode {Multidimensional | PowerPivot | Tabular}] [-ASSvcAccount <string>] [-ASSvcPassword
    <securestring>] [-ASSvcStartupType {Automatic | Disabled | Manual}] [-ASSysAdminAccounts <string[]>] [-ASProviderMSOLAP] [-BrowserSvcStartupType
    {Automatic | Disabled | Manual}] [-EnableRanU] [-InstallSqlDataDir <string>] [-SqlBackupDir <string>] [-SecurityMode {SQL}] [-SAPwd
    <securestring>] [-SqlCollation <string>] [-SqlSvcAccount <string>] [-SqlSvcPassword <securestring>] [-SqlSvcStartupType {Automatic | Disabled |
    Manual}] [-SqlTempDbDir <string>] [-SqlTempDbLogDir <string>] [-SqlTempDbFileCount <ushort>] [-SqlTempDbFileSize <ushort>] [-SqlTempDbFileGrowth
    <ushort>] [-SqlTempDbLogFileSize <ushort>] [-SqlTempDbLogFileGrowth <ushort>] [-SqlUserDbDir <string>] [-SqlSvcInstantFileInit]
    [-SqlUserDbLogDir <string>] [-SqlMaxDop <ushort>] [-UseSqlRecommendedMemoryLimits] [-SqlMinMemory <uint>] [-SqlMaxMemory <uint>]
    [-FileStreamLevel <ushort>] [-FileStreamShareName <string>] [-ISSvcAccount <string>] [-ISSvcPassword <securestring>] [-ISSvcStartupType
    {Automatic | Disabled | Manual}] [-NpEnabled] [-TcpEnabled] [-RsInstallMode {SharePointFilesOnlyMode | DefaultNativeMode | FilesOnlyMode}]
    [-RSSvcAccount <string>] [-RSSvcPassword <securestring>] [-RSSvcStartupType {Automatic | Disabled | Manual}] [-MPYCacheDirectory <string>]
    [-MRCacheDirectory <string>] [-SqlInstJava] [-SqlJavaDir <string>] [-AzureSubscriptionId <string>] [-AzureResourceGroup <string>] [-AzureRegion
    <string>] [-AzureTenantId <string>] [-AzureServicePrincipal <string>] [-AzureServicePrincipalSecret <securestring>] [-AzureArcProxy <string>]
    [-SkipRules <string[]>] [-Timeout <uint>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-SqlDscServer -PrepareImage -AcceptLicensingTerms -MediaPath <string> -InstanceName <string> -Features {SQL | SQLEngine | Replication |
    FullText | DQ | PolyBase | PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR | SQL_INST_MPY | SQL_INST_JAVA | AS | RS | RS_SHP |
    RS_SHPWFE | DQC | IS | IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools | BC | Conn | DREPLAY_CTLR | DREPLAY_CLT | SNAC_SDK
    | SDK | LocalDB | ARC} -InstanceId <string> [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource <string>] [-InstallSharedDir
    <string>] [-InstanceDir <string>] [-PBEngSvcAccount <string>] [-PBEngSvcPassword <securestring>] [-PBEngSvcStartupType {Automatic | Disabled |
    Manual}] [-PBStartPortRange <ushort>] [-PBEndPortRange <ushort>] [-PBScaleOut] [-Timeout <uint>] [-Force] [-WhatIf] [-Confirm]
    [<CommonParameters>]

    Install-SqlDscServer -Upgrade -AcceptLicensingTerms -MediaPath <string> -InstanceName <string> [-Enu] [-UpdateEnabled] [-UpdateSource <string>]
    [-InstanceDir <string>] [-InstanceId <string>] [-ProductKey <string>] [-BrowserSvcStartupType {Automatic | Disabled | Manual}] [-FTUpgradeOption
    {Rebuild | Reset | Import}] [-ISSvcAccount <string>] [-ISSvcPassword <securestring>] [-ISSvcStartupType {Automatic | Disabled | Manual}]
    [-AllowUpgradeForSSRSSharePointMode] [-FailoverClusterRollOwnership <ushort>] [-Timeout <uint>] [-Force] [-WhatIf] [-Confirm]
    [<CommonParameters>]

    Install-SqlDscServer -EditionUpgrade -AcceptLicensingTerms -MediaPath <string> -InstanceName <string> -ProductKey <string> [-SkipRules
    <string[]>] [-Timeout <uint>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-SqlDscServer -InstallFailoverCluster -AcceptLicensingTerms -MediaPath <string> -InstanceName <string> -Features {SQL | SQLEngine |
    Replication | FullText | DQ | PolyBase | PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR | SQL_INST_MPY | SQL_INST_JAVA | AS | RS
    | RS_SHP | RS_SHPWFE | DQC | IS | IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools | BC | Conn | DREPLAY_CTLR | DREPLAY_CLT
    | SNAC_SDK | SDK | LocalDB | ARC} -InstallSqlDataDir <string> -SqlSysAdminAccounts <string[]> -FailoverClusterNetworkName <string>
    -FailoverClusterIPAddresses <string[]> [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource <string>] [-InstallSharedDir <string>]
    [-InstallSharedWowDir <string>] [-InstanceDir <string>] [-InstanceId <string>] [-PBEngSvcAccount <string>] [-PBEngSvcPassword <securestring>]
    [-PBEngSvcStartupType {Automatic | Disabled | Manual}] [-PBStartPortRange <ushort>] [-PBEndPortRange <ushort>] [-PBScaleOut] [-ProductKey
    <string>] [-AgtSvcAccount <string>] [-AgtSvcPassword <securestring>] [-ASBackupDir <string>] [-ASCollation <string>] [-ASConfigDir <string>]
    [-ASDataDir <string>] [-ASLogDir <string>] [-ASTempDir <string>] [-ASServerMode {Multidimensional | PowerPivot | Tabular}] [-ASSvcAccount
    <string>] [-ASSvcPassword <securestring>] [-ASSvcStartupType {Automatic | Disabled | Manual}] [-ASSysAdminAccounts <string[]>]
    [-ASProviderMSOLAP] [-SqlBackupDir <string>] [-SecurityMode {SQL}] [-SAPwd <securestring>] [-SqlCollation <string>] [-SqlSvcAccount <string>]
    [-SqlSvcPassword <securestring>] [-SqlSvcStartupType {Automatic | Disabled | Manual}] [-SqlTempDbDir <string>] [-SqlTempDbLogDir <string>]
    [-SqlTempDbFileCount <ushort>] [-SqlTempDbFileSize <ushort>] [-SqlTempDbFileGrowth <ushort>] [-SqlTempDbLogFileSize <ushort>]
    [-SqlTempDbLogFileGrowth <ushort>] [-SqlUserDbDir <string>] [-SqlUserDbLogDir <string>] [-FileStreamLevel <ushort>] [-FileStreamShareName
    <string>] [-ISSvcAccount <string>] [-ISSvcPassword <securestring>] [-ISSvcStartupType {Automatic | Disabled | Manual}] [-RsInstallMode
    {SharePointFilesOnlyMode | DefaultNativeMode | FilesOnlyMode}] [-RSSvcAccount <string>] [-RSSvcPassword <securestring>] [-RSSvcStartupType
    {Automatic | Disabled | Manual}] [-FailoverClusterGroup <string>] [-FailoverClusterDisks <string[]>] [-SkipRules <string[]>] [-Timeout <uint>]
    [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-SqlDscServer -PrepareFailoverCluster -AcceptLicensingTerms -MediaPath <string> -InstanceName <string> -Features {SQL | SQLEngine |
    Replication | FullText | DQ | PolyBase | PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR | SQL_INST_MPY | SQL_INST_JAVA | AS | RS
    | RS_SHP | RS_SHPWFE | DQC | IS | IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools | BC | Conn | DREPLAY_CTLR | DREPLAY_CLT
    | SNAC_SDK | SDK | LocalDB | ARC} [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource <string>] [-InstallSharedDir <string>]
    [-InstallSharedWowDir <string>] [-InstanceDir <string>] [-InstanceId <string>] [-PBEngSvcAccount <string>] [-PBEngSvcPassword <securestring>]
    [-PBEngSvcStartupType {Automatic | Disabled | Manual}] [-PBStartPortRange <ushort>] [-PBEndPortRange <ushort>] [-PBScaleOut] [-ProductKey
    <string>] [-AgtSvcAccount <string>] [-AgtSvcPassword <securestring>] [-ASSvcAccount <string>] [-ASSvcPassword <securestring>] [-SqlSvcAccount
    <string>] [-SqlSvcPassword <securestring>] [-FileStreamLevel <ushort>] [-FileStreamShareName <string>] [-ISSvcAccount <string>] [-ISSvcPassword
    <securestring>] [-ISSvcStartupType {Automatic | Disabled | Manual}] [-RsInstallMode {SharePointFilesOnlyMode | DefaultNativeMode |
    FilesOnlyMode}] [-RSSvcAccount <string>] [-RSSvcPassword <securestring>] [-RSSvcStartupType {Automatic | Disabled | Manual}] [-Timeout <uint>]
    [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-SqlDscServer -ConfigurationFile <string> -MediaPath <string> [-AgtSvcPassword <securestring>] [-ASSvcPassword <securestring>]
    [-SqlSvcPassword <securestring>] [-ISSvcPassword <securestring>] [-RSSvcPassword <securestring>] [-Timeout <uint>] [-Force] [-WhatIf] [-Confirm]
    [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Uninstall-SqlDscServer
NAME
    Uninstall-SqlDscServer

SYNTAX
    Uninstall-SqlDscServer [-MediaPath] <string> [-InstanceName] <string> [[-Features] {SQL | SQLEngine | Replication | FullText | DQ | PolyBase |
    PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR | SQL_INST_MPY | SQL_INST_JAVA | AS | RS | RS_SHP | RS_SHPWFE | DQC | IS |
    IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools | BC | Conn | DREPLAY_CTLR | DREPLAY_CLT | SNAC_SDK | SDK | LocalDB | ARC}]
    [[-Timeout] <uint>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Add-SqlDscNode
NAME
    Add-SqlDscNode

SYNTAX
    Add-SqlDscNode [-MediaPath] <string> [-InstanceName] <string> [[-UpdateSource] <string>] [[-PBEngSvcAccount] <string>] [[-PBEngSvcPassword]
    <securestring>] [[-PBEngSvcStartupType] {Automatic | Disabled | Manual}] [[-PBStartPortRange] <ushort>] [[-PBEndPortRange] <ushort>]
    [[-ProductKey] <string>] [[-AgtSvcAccount] <string>] [[-AgtSvcPassword] <securestring>] [[-ASSvcAccount] <string>] [[-ASSvcPassword]
    <securestring>] [[-SqlSvcAccount] <string>] [[-SqlSvcPassword] <securestring>] [[-ISSvcAccount] <string>] [[-ISSvcPassword] <securestring>]
    [[-RsInstallMode] {SharePointFilesOnlyMode | DefaultNativeMode | FilesOnlyMode}] [[-RSSvcAccount] <string>] [[-RSSvcPassword] <securestring>]
    [-FailoverClusterIPAddresses] <string[]> [[-Timeout] <uint>] -AcceptLicensingTerms [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled]
    [-PBScaleOut] [-ConfirmIPDependencyChange] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Remove-SqlDscNode
NAME
    Remove-SqlDscNode

SYNTAX
    Remove-SqlDscNode [-MediaPath] <string> [-InstanceName] <string> [[-Timeout] <uint>] [-ConfirmIPDependencyChange] [-Force] [-WhatIf] [-Confirm]
    [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Repair-SqlDscServer
NAME
    Repair-SqlDscServer

SYNTAX
    Repair-SqlDscServer [-MediaPath] <string> [-InstanceName] <string> [-Features] {SQL | SQLEngine | Replication | FullText | DQ | PolyBase |
    PolyBaseCore | PolyBaseJava | AdvancedAnalytics | SQL_INST_MR | SQL_INST_MPY | SQL_INST_JAVA | AS | RS | RS_SHP | RS_SHPWFE | DQC | IS |
    IS_Master | IS_Worker | MDS | SQL_SHARED_MPY | SQL_SHARED_MR | Tools | BC | Conn | DREPLAY_CTLR | DREPLAY_CLT | SNAC_SDK | SDK | LocalDB | ARC}
    [[-PBEngSvcAccount] <string>] [[-PBEngSvcPassword] <securestring>] [[-PBEngSvcStartupType] {Automatic | Disabled | Manual}] [[-PBStartPortRange]
    <ushort>] [[-PBEndPortRange] <ushort>] [[-Timeout] <uint>] [-Enu] [-PBScaleOut] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Complete-SqlDscImage
NAME
    Complete-SqlDscImage

SYNTAX
    Complete-SqlDscImage [-MediaPath] <string> [[-InstanceName] <string>] [[-InstanceId] <string>] [[-PBEngSvcAccount] <string>]
    [[-PBEngSvcPassword] <securestring>] [[-PBEngSvcStartupType] {Automatic | Disabled | Manual}] [[-PBStartPortRange] <ushort>] [[-PBEndPortRange]
    <ushort>] [[-ProductKey] <string>] [[-AgtSvcAccount] <string>] [[-AgtSvcPassword] <securestring>] [[-AgtSvcStartupType] {Automatic | Disabled |
    Manual}] [[-BrowserSvcStartupType] {Automatic | Disabled | Manual}] [[-InstallSqlDataDir] <string>] [[-SqlBackupDir] <string>] [[-SecurityMode]
    {SQL}] [[-SAPwd] <securestring>] [[-SqlCollation] <string>] [[-SqlSvcAccount] <string>] [[-SqlSvcPassword] <securestring>] [[-SqlSvcStartupType]
    {Automatic | Disabled | Manual}] [[-SqlSysAdminAccounts] <string[]>] [[-SqlTempDbDir] <string>] [[-SqlTempDbLogDir] <string>]
    [[-SqlTempDbFileCount] <ushort>] [[-SqlTempDbFileSize] <ushort>] [[-SqlTempDbFileGrowth] <ushort>] [[-SqlTempDbLogFileSize] <ushort>]
    [[-SqlTempDbLogFileGrowth] <ushort>] [[-SqlUserDbDir] <string>] [[-SqlUserDbLogDir] <string>] [[-FileStreamLevel] <ushort>]
    [[-FileStreamShareName] <string>] [[-RsInstallMode] {SharePointFilesOnlyMode | DefaultNativeMode | FilesOnlyMode}] [[-RSSvcAccount] <string>]
    [[-RSSvcPassword] <securestring>] [[-RSSvcStartupType] {Automatic | Disabled | Manual}] [[-Timeout] <uint>] -AcceptLicensingTerms [-Enu]
    [-PBScaleOut] [-EnableRanU] [-NpEnabled] [-TcpEnabled] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Complete-SqlDscFailoverCluster
NAME
    Complete-SqlDscFailoverCluster

SYNTAX
    Complete-SqlDscFailoverCluster [-MediaPath] <string> [-InstanceName] <string> [[-ProductKey] <string>] [[-ASBackupDir] <string>] [[-ASCollation]
    <string>] [[-ASConfigDir] <string>] [[-ASDataDir] <string>] [[-ASLogDir] <string>] [[-ASTempDir] <string>] [[-ASServerMode] {Multidimensional |
    PowerPivot | Tabular}] [[-ASSysAdminAccounts] <string[]>] [-InstallSqlDataDir] <string> [[-SqlBackupDir] <string>] [[-SecurityMode] {SQL}]
    [[-SAPwd] <securestring>] [[-SqlCollation] <string>] [-SqlSysAdminAccounts] <string[]> [[-SqlTempDbDir] <string>] [[-SqlTempDbLogDir] <string>]
    [[-SqlTempDbFileCount] <ushort>] [[-SqlTempDbFileSize] <ushort>] [[-SqlTempDbFileGrowth] <ushort>] [[-SqlTempDbLogFileSize] <ushort>]
    [[-SqlTempDbLogFileGrowth] <ushort>] [[-SqlUserDbDir] <string>] [[-SqlUserDbLogDir] <string>] [[-RsInstallMode] {SharePointFilesOnlyMode |
    DefaultNativeMode | FilesOnlyMode}] [[-FailoverClusterGroup] <string>] [[-FailoverClusterDisks] <string[]>] [-FailoverClusterNetworkName]
    <string> [-FailoverClusterIPAddresses] <string[]> [[-Timeout] <uint>] [-Enu] [-ASProviderMSOLAP] [-ConfirmIPDependencyChange] [-Force] [-WhatIf]
    [-Confirm] [<CommonParameters>]


ALIASES
    None


REMARKS
    None
Initialize-SqlDscRebuildDatabase
NAME
    Initialize-SqlDscRebuildDatabase

SYNTAX
    Initialize-SqlDscRebuildDatabase [-MediaPath] <string> [-InstanceName] <string> [[-SAPwd] <securestring>] [[-SqlCollation] <string>]
    [-SqlSysAdminAccounts] <string[]> [[-SqlTempDbDir] <string>] [[-SqlTempDbLogDir] <string>] [[-SqlTempDbFileCount] <ushort>]
    [[-SqlTempDbFileSize] <ushort>] [[-SqlTempDbFileGrowth] <ushort>] [[-SqlTempDbLogFileSize] <ushort>] [[-SqlTempDbLogFileGrowth] <ushort>]
    [[-Timeout] <uint>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]


ALIASES
    None


REMARKS
    None

This Pull Request (PR) fixes the following issues

In preparation for issue #1781.

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju added the needs review The pull request needs a code review. label Aug 30, 2022
@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #1784 (73e4986) into main (22abcdb) will increase coverage by 0%.
The diff coverage is 94%.

Impacted file tree graph

@@          Coverage Diff          @@
##           main   #1784    +/-   ##
=====================================
  Coverage    88%     88%            
=====================================
  Files        69      83    +14     
  Lines      7226    7443   +217     
=====================================
+ Hits       6387    6593   +206     
- Misses      839     850    +11     
Flag Coverage Δ
unit 88% <94%> (+<1%) ⬆️
Impacted Files Coverage Δ
...dules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 98% <ø> (ø)
source/Private/Assert-ElevatedUser.ps1 85% <85%> (ø)
source/Private/Invoke-SetupAction.ps1 92% <92%> (ø)
source/Private/Assert-SetupActionProperties.ps1 98% <98%> (ø)
source/Private/Assert-RequiredCommandParameter.ps1 100% <100%> (ø)
source/Private/Test-IsNumericType.ps1 100% <100%> (ø)
...rce/Private/Test-ServiceAccountRequirePassword.ps1 100% <100%> (ø)
source/Public/Add-SqlDscNode.ps1 100% <100%> (ø)
source/Public/Complete-SqlDscFailoverCluster.ps1 100% <100%> (ø)
source/Public/Complete-SqlDscImage.ps1 100% <100%> (ø)
... and 5 more

@johlju johlju force-pushed the f/command-Install-SqlDscServer branch from b484ebd to 0f1cddf Compare September 3, 2022 11:23
@johlju
Copy link
Member Author

johlju commented Sep 8, 2022

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@johlju johlju force-pushed the f/command-Install-SqlDscServer branch from 51ef128 to 765f51a Compare September 18, 2022 10:31
@johlju johlju added needs review The pull request needs a code review. and removed waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Nov 20, 2022
@johlju
Copy link
Member Author

johlju commented Nov 20, 2022

It seems there has been new arguments (at least one) added and values for arguments has been changed (at least 'ARC' seems to have changed) for SQL Server 2022. I will add an issue for that so it can be resolved in another PR.

@johlju
Copy link
Member Author

johlju commented Nov 20, 2022

This PR is ready for review again.

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 10 of 16 files at r1, 7 of 10 files at r2, 9 of 13 files at r3, 6 of 6 files at r4, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @wsmelton)


source/Private/Assert-ElevatedUser.ps1 line 16 at r4 (raw file):

        None.
#>
function Assert-ElevatedUser

We should look at moving this to DscResource.Common (as a public command). Will create a seperate issue for this.

Code quote:

Assert-ElevatedUser

source/Private/Assert-ElevatedUser.ps1 line 39 at r4 (raw file):

            [System.Management.Automation.ErrorRecord]::new(
                $script:localizedData.IsElevated_UserNotElevated,
                'TIE0001',

Should be changed to

Suggestion:

AEU0001

source/Private/Assert-RequiredCommandParameter.ps1 line 37 at r4 (raw file):

        in the module DscResource.Common, instead of being a separate command.
#>
function Assert-RequiredCommandParameter

We should look at moving this to DscResource.Common (as a public command). Will create a seperate issue for this.

This could be a private function but is called by public command Assert-BoundParameter that implements a new parmeter set.

Code quote:

Assert-RequiredCommandParameter

source/Private/Invoke-SetupAction.ps1 line 1387 at r4 (raw file):

                [System.Management.Automation.ErrorRecord]::new(
                    ('{0} {1}' -f $setupExitMessage, $script:localizedData.Server_SetupFailed),
                    'ISDS0001', # cspell: disable-line

Should change to

Suggestion:

IS0001

source/Private/Test-IsNumericType.ps1 line 19 at r4 (raw file):

        [System.Boolean]
#>
function Test-IsNumericType

We should look at moving this to DscResource.Common (as a public command). Will create a seperate issue for this.

Code quote:

Test-IsNumericType

source/Private/Test-ServiceAccountRequirePassword.ps1 line 16 at r4 (raw file):

        [System.Boolean]
#>
function Test-ServiceAccountRequirePassword

We should look at moving this to DscResource.Common (as a public command). Will create a seperate issue for this. Maybe change from "ServiceAccount" to the more generic "Account" in the public command.

Code quote:

Test-ServiceAccountRequirePassword

source/Private/Assert-SetupActionProperties.ps1 line 24 at r4 (raw file):

    .NOTES
        This function is used by the command Install-SqlDscServer to verify that

Should be changed to:

Suggestion:

Invoke-SetupAction

source/Private/Assert-SetupActionProperties.ps1 line 165 at r4 (raw file):

                [System.Management.Automation.ErrorRecord]::new(
                    ($script:localizedData.InstallSqlServerProperties_ASServerModeInvalidValue -f $SetupAction),
                    'AISSP0001', # cSpell: disable-line

Should change to

Suggestion:

ASAP0001

source/Private/Assert-SetupActionProperties.ps1 line 181 at r4 (raw file):

                [System.Management.Automation.ErrorRecord]::new(
                    ($script:localizedData.InstallSqlServerProperties_RsInstallModeInvalidValue -f $SetupAction),
                    'AISSP0002', # cSpell: disable-line

Should change to

Suggestion:

ASAP0002

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r5, all commit messages.
Dismissed @wsmelton from 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)


source/Private/Assert-ElevatedUser.ps1 line 39 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Should be changed to

Done


source/Private/Invoke-SetupAction.ps1 line 1387 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Should change to

Done


source/Public/Install-SqlDscServer.ps1 line 429 at r1 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Changed to SecureString on all password parameters.

Done


source/Public/Install-SqlDscServer.ps1 line 686 at r1 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

@wsmelton thank you for your comments. Much appreciated! 🙇

Done


source/Private/Assert-SetupActionProperties.ps1 line 24 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Should be changed to:

Done


source/Private/Assert-SetupActionProperties.ps1 line 165 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Should change to

Done


source/Private/Assert-SetupActionProperties.ps1 line 181 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Should change to

Done

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@johlju johlju merged commit 1026d20 into dsccommunity:main Nov 24, 2022
@johlju johlju deleted the f/command-Install-SqlDscServer branch November 24, 2022 07:39
@johlju johlju removed the needs review The pull request needs a code review. label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants