From 51ef12857e251a749b97e656e324bccadd363882 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 18 Sep 2022 12:23:28 +0200 Subject: [PATCH] Fix argument IACKNOWLEDGEENTCALLIMITS --- source/Public/Install-SqlDscServer.ps1 | 11 ++++++++++- tests/Unit/Public/Install-SqlDscServer.Tests.ps1 | 12 ++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/source/Public/Install-SqlDscServer.ps1 b/source/Public/Install-SqlDscServer.ps1 index caf8e2e9be..b38cdb57d8 100644 --- a/source/Public/Install-SqlDscServer.ps1 +++ b/source/Public/Install-SqlDscServer.ps1 @@ -248,6 +248,15 @@ function Install-SqlDscServer [System.Management.Automation.SwitchParameter] $SuppressPrivacyStatementNotice, + [Parameter(ParameterSetName = 'Install')] + [Parameter(ParameterSetName = 'InstallRole')] + [Parameter(ParameterSetName = 'PrepareImage')] + [Parameter(ParameterSetName = 'InstallFailoverCluster')] + [Parameter(ParameterSetName = 'PrepareFailoverCluster')] + [Parameter(ParameterSetName = 'AddNode')] + [System.Management.Automation.SwitchParameter] + $IAcknowledgeEntCalLimits, + [Parameter(Mandatory = $true)] [ValidateScript({ if (-not (Test-Path -Path (Join-Path -Path $_ -ChildPath 'setup.exe'))) @@ -1262,7 +1271,7 @@ function Install-SqlDscServer Excluding parameter names that shall be handled differently, those arguments shall not have any value after argument name, e.g. '/ENU'. #> - { $parameterName -in @('UPDATEENABLED', 'PBSCALEOUT', 'SQLSVCINSTANTFILEINIT', 'ALLOWUPGRADEFORSSRSSHAREPOINTMODE', 'ADDCURRENTUSERASSQLADMIN') } # cspell: disable-line + { $parameterName -in @('UPDATEENABLED', 'PBSCALEOUT', 'SQLSVCINSTANTFILEINIT', 'ALLOWUPGRADEFORSSRSSHAREPOINTMODE', 'ADDCURRENTUSERASSQLADMIN', 'IACKNOWLEDGEENTCALLIMITS') } # cspell: disable-line { $setupArgument += '={0}' -f $PSBoundParameters.$parameterName.ToString() diff --git a/tests/Unit/Public/Install-SqlDscServer.Tests.ps1 b/tests/Unit/Public/Install-SqlDscServer.Tests.ps1 index 900ae261eb..b48a925dee 100644 --- a/tests/Unit/Public/Install-SqlDscServer.Tests.ps1 +++ b/tests/Unit/Public/Install-SqlDscServer.Tests.ps1 @@ -48,12 +48,12 @@ Describe 'Install-SqlDscServer' -Tag 'Public' { @{ MockParameterSetName = 'Install' # cSpell: disable-next - MockExpectedParameters = '-Install -AcceptLicensingTerms -MediaPath -InstanceName -Features -SqlSysAdminAccounts [-SuppressPrivacyStatementNotice] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBDMSSvcAccount ] [-PBDMSSvcPassword ] [-PBDMSSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-AgtSvcStartupType ] [-ASBackupDir ] [-ASCollation ] [-ASConfigDir ] [-ASDataDir ] [-ASLogDir ] [-ASTempDir ] [-ASServerMode ] [-ASSvcAccount ] [-ASSvcPassword ] [-ASSvcStartupType ] [-ASSysAdminAccounts ] [-ASProviderMSOLAP] [-BrowserSvcStartupType ] [-EnableRanU] [-InstallSqlDataDir ] [-SqlBackupDir ] [-SecurityMode ] [-SAPwd ] [-SqlCollation ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-SqlSvcStartupType ] [-SqlTempDbDir ] [-SqlTempDbLogDir ] [-SqlTempDbFileCount ] [-SqlTempDbFileSize ] [-SqlTempDbFileGrowth ] [-SqlTempDbLogFileSize ] [-SqlTempDbLogFileGrowth ] [-SqlUserDbDir ] [-SqlSvcInstantFileInit] [-SqlUserDbLogDir ] [-SqlMaxDop ] [-UseSqlRecommendedMemoryLimits] [-SqlMinMemory ] [-SqlMaxMemory ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-NpEnabled] [-TcpEnabled] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-MPYCacheDirectory ] [-MRCacheDirectory ] [-SqlInstJava] [-SqlJavaDir ] [-AzureSubscriptionId ] [-AzureResourceGroup ] [-AzureRegion ] [-AzureTenantId ] [-AzureServicePrincipal ] [-AzureServicePrincipalSecret ] [-AzureArcProxy ] [-SkipRules ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '-Install -AcceptLicensingTerms -MediaPath -InstanceName -Features -SqlSysAdminAccounts [-SuppressPrivacyStatementNotice] [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBDMSSvcAccount ] [-PBDMSSvcPassword ] [-PBDMSSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-AgtSvcStartupType ] [-ASBackupDir ] [-ASCollation ] [-ASConfigDir ] [-ASDataDir ] [-ASLogDir ] [-ASTempDir ] [-ASServerMode ] [-ASSvcAccount ] [-ASSvcPassword ] [-ASSvcStartupType ] [-ASSysAdminAccounts ] [-ASProviderMSOLAP] [-BrowserSvcStartupType ] [-EnableRanU] [-InstallSqlDataDir ] [-SqlBackupDir ] [-SecurityMode ] [-SAPwd ] [-SqlCollation ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-SqlSvcStartupType ] [-SqlTempDbDir ] [-SqlTempDbLogDir ] [-SqlTempDbFileCount ] [-SqlTempDbFileSize ] [-SqlTempDbFileGrowth ] [-SqlTempDbLogFileSize ] [-SqlTempDbLogFileGrowth ] [-SqlUserDbDir ] [-SqlSvcInstantFileInit] [-SqlUserDbLogDir ] [-SqlMaxDop ] [-UseSqlRecommendedMemoryLimits] [-SqlMinMemory ] [-SqlMaxMemory ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-NpEnabled] [-TcpEnabled] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-MPYCacheDirectory ] [-MRCacheDirectory ] [-SqlInstJava] [-SqlJavaDir ] [-AzureSubscriptionId ] [-AzureResourceGroup ] [-AzureRegion ] [-AzureTenantId ] [-AzureServicePrincipal ] [-AzureServicePrincipalSecret ] [-AzureArcProxy ] [-SkipRules ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' } @{ MockParameterSetName = 'InstallRole' # cSpell: disable-next - MockExpectedParameters = '-Install -AcceptLicensingTerms -MediaPath -Role [-SuppressPrivacyStatementNotice] [-InstanceName ] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-Features ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBDMSSvcAccount ] [-PBDMSSvcPassword ] [-PBDMSSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-AgtSvcStartupType ] [-ASBackupDir ] [-ASCollation ] [-ASConfigDir ] [-ASDataDir ] [-ASLogDir ] [-ASTempDir ] [-ASServerMode ] [-ASSvcAccount ] [-ASSvcPassword ] [-ASSvcStartupType ] [-ASSysAdminAccounts ] [-ASProviderMSOLAP] [-FarmAccount ] [-FarmPassword ] [-Passphrase ] [-FarmAdminiPort ] [-BrowserSvcStartupType ] [-EnableRanU] [-InstallSqlDataDir ] [-SqlBackupDir ] [-SecurityMode ] [-SAPwd ] [-SqlCollation ] [-AddCurrentUserAsSqlAdmin] [-SqlSvcAccount ] [-SqlSvcPassword ] [-SqlSvcStartupType ] [-SqlSysAdminAccounts ] [-SqlTempDbDir ] [-SqlTempDbLogDir ] [-SqlTempDbFileCount ] [-SqlTempDbFileSize ] [-SqlTempDbFileGrowth ] [-SqlTempDbLogFileSize ] [-SqlTempDbLogFileGrowth ] [-SqlUserDbDir ] [-SqlSvcInstantFileInit] [-SqlUserDbLogDir ] [-SqlMaxDop ] [-UseSqlRecommendedMemoryLimits] [-SqlMinMemory ] [-SqlMaxMemory ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-NpEnabled] [-TcpEnabled] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-MPYCacheDirectory ] [-MRCacheDirectory ] [-SqlInstJava] [-SqlJavaDir ] [-AzureSubscriptionId ] [-AzureResourceGroup ] [-AzureRegion ] [-AzureTenantId ] [-AzureServicePrincipal ] [-AzureServicePrincipalSecret ] [-AzureArcProxy ] [-SkipRules ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '-Install -AcceptLicensingTerms -MediaPath -Role [-SuppressPrivacyStatementNotice] [-IAcknowledgeEntCalLimits] [-InstanceName ] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-Features ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBDMSSvcAccount ] [-PBDMSSvcPassword ] [-PBDMSSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-AgtSvcStartupType ] [-ASBackupDir ] [-ASCollation ] [-ASConfigDir ] [-ASDataDir ] [-ASLogDir ] [-ASTempDir ] [-ASServerMode ] [-ASSvcAccount ] [-ASSvcPassword ] [-ASSvcStartupType ] [-ASSysAdminAccounts ] [-ASProviderMSOLAP] [-FarmAccount ] [-FarmPassword ] [-Passphrase ] [-FarmAdminiPort ] [-BrowserSvcStartupType ] [-EnableRanU] [-InstallSqlDataDir ] [-SqlBackupDir ] [-SecurityMode ] [-SAPwd ] [-SqlCollation ] [-AddCurrentUserAsSqlAdmin] [-SqlSvcAccount ] [-SqlSvcPassword ] [-SqlSvcStartupType ] [-SqlSysAdminAccounts ] [-SqlTempDbDir ] [-SqlTempDbLogDir ] [-SqlTempDbFileCount ] [-SqlTempDbFileSize ] [-SqlTempDbFileGrowth ] [-SqlTempDbLogFileSize ] [-SqlTempDbLogFileGrowth ] [-SqlUserDbDir ] [-SqlSvcInstantFileInit] [-SqlUserDbLogDir ] [-SqlMaxDop ] [-UseSqlRecommendedMemoryLimits] [-SqlMinMemory ] [-SqlMaxMemory ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-NpEnabled] [-TcpEnabled] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-MPYCacheDirectory ] [-MRCacheDirectory ] [-SqlInstJava] [-SqlJavaDir ] [-AzureSubscriptionId ] [-AzureResourceGroup ] [-AzureRegion ] [-AzureTenantId ] [-AzureServicePrincipal ] [-AzureServicePrincipalSecret ] [-AzureArcProxy ] [-SkipRules ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' } @{ MockParameterSetName = 'InstallAzureArcAgent' @@ -74,7 +74,7 @@ Describe 'Install-SqlDscServer' -Tag 'Public' { @{ MockParameterSetName = 'PrepareImage' # cSpell: disable-next - MockExpectedParameters = '-PrepareImage -AcceptLicensingTerms -MediaPath -InstanceName -Features -InstanceId [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstanceDir ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '-PrepareImage -AcceptLicensingTerms -MediaPath -InstanceName -Features -InstanceId [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstanceDir ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' } @{ MockParameterSetName = 'CompleteImage' @@ -104,12 +104,12 @@ Describe 'Install-SqlDscServer' -Tag 'Public' { @{ MockParameterSetName = 'InstallFailoverCluster' # cSpell: disable-next - MockExpectedParameters = '-InstallFailoverCluster -AcceptLicensingTerms -MediaPath -InstanceName -Features -InstallSqlDataDir -SqlSysAdminAccounts -FailoverClusterNetworkName -FailoverClusterIPAddresses [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-ASBackupDir ] [-ASCollation ] [-ASConfigDir ] [-ASDataDir ] [-ASLogDir ] [-ASTempDir ] [-ASServerMode ] [-ASSvcAccount ] [-ASSvcPassword ] [-ASSvcStartupType ] [-ASSysAdminAccounts ] [-ASProviderMSOLAP] [-SqlBackupDir ] [-SecurityMode ] [-SAPwd ] [-SqlCollation ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-SqlSvcStartupType ] [-SqlTempDbDir ] [-SqlTempDbLogDir ] [-SqlTempDbFileCount ] [-SqlTempDbFileSize ] [-SqlTempDbFileGrowth ] [-SqlTempDbLogFileSize ] [-SqlTempDbLogFileGrowth ] [-SqlUserDbDir ] [-SqlUserDbLogDir ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-FailoverClusterGroup ] [-FailoverClusterDisks ] [-SkipRules ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '-InstallFailoverCluster -AcceptLicensingTerms -MediaPath -InstanceName -Features -InstallSqlDataDir -SqlSysAdminAccounts -FailoverClusterNetworkName -FailoverClusterIPAddresses [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-ASBackupDir ] [-ASCollation ] [-ASConfigDir ] [-ASDataDir ] [-ASLogDir ] [-ASTempDir ] [-ASServerMode ] [-ASSvcAccount ] [-ASSvcPassword ] [-ASSvcStartupType ] [-ASSysAdminAccounts ] [-ASProviderMSOLAP] [-SqlBackupDir ] [-SecurityMode ] [-SAPwd ] [-SqlCollation ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-SqlSvcStartupType ] [-SqlTempDbDir ] [-SqlTempDbLogDir ] [-SqlTempDbFileCount ] [-SqlTempDbFileSize ] [-SqlTempDbFileGrowth ] [-SqlTempDbLogFileSize ] [-SqlTempDbLogFileGrowth ] [-SqlUserDbDir ] [-SqlUserDbLogDir ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-FailoverClusterGroup ] [-FailoverClusterDisks ] [-SkipRules ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' } @{ MockParameterSetName = 'PrepareFailoverCluster' # cSpell: disable-next - MockExpectedParameters = '-PrepareFailoverCluster -AcceptLicensingTerms -MediaPath -InstanceName -Features [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-ASSvcAccount ] [-ASSvcPassword ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '-PrepareFailoverCluster -AcceptLicensingTerms -MediaPath -InstanceName -Features [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-InstallSharedDir ] [-InstallSharedWowDir ] [-InstanceDir ] [-InstanceId ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-ASSvcAccount ] [-ASSvcPassword ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-FileStreamLevel ] [-FileStreamShareName ] [-ISSvcAccount ] [-ISSvcPassword ] [-ISSvcStartupType ] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-RSSvcStartupType ] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' } @{ MockParameterSetName = 'CompleteFailoverCluster' @@ -119,7 +119,7 @@ Describe 'Install-SqlDscServer' -Tag 'Public' { @{ MockParameterSetName = 'AddNode' # cSpell: disable-next - MockExpectedParameters = '-AddNode -AcceptLicensingTerms -MediaPath -InstanceName -FailoverClusterIPAddresses [-Enu] [-UpdateEnabled] [-UpdateSource ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-ASSvcAccount ] [-ASSvcPassword ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-ISSvcAccount ] [-ISSvcPassword ] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-ConfirmIPDependencyChange] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '-AddNode -AcceptLicensingTerms -MediaPath -InstanceName -FailoverClusterIPAddresses [-IAcknowledgeEntCalLimits] [-Enu] [-UpdateEnabled] [-UpdateSource ] [-PBEngSvcAccount ] [-PBEngSvcPassword ] [-PBEngSvcStartupType ] [-PBStartPortRange ] [-PBEndPortRange ] [-PBScaleOut] [-ProductKey ] [-AgtSvcAccount ] [-AgtSvcPassword ] [-ASSvcAccount ] [-ASSvcPassword ] [-SqlSvcAccount ] [-SqlSvcPassword ] [-ISSvcAccount ] [-ISSvcPassword ] [-RsInstallMode ] [-RSSvcAccount ] [-RSSvcPassword ] [-ConfirmIPDependencyChange] [-Timeout ] [-Force] [-WhatIf] [-Confirm] []' } @{ MockParameterSetName = 'RemoveNode'