Skip to content

Commit b883a26

Browse files
committed
Update Invoke-SetupAction documentation to clarify Repair action behavior and remove FEATURES parameter requirement
1 parent 542be63 commit b883a26

File tree

4 files changed

+29
-47
lines changed

4 files changed

+29
-47
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
[issue #2238](https://github.com/dsccommunity/SqlServerDsc/issues/2238).
1414
- Added integration tests for `ConvertTo-SqlDscServerPermission` command to ensure
1515
command reliability [issue #2207](https://github.com/dsccommunity/SqlServerDsc/issues/2207).
16+
- Added integration tests for `ConvertTo-SqlDscServerPermission` command to ensure
17+
command reliability [issue #2207](https://github.com/dsccommunity/SqlServerDsc/issues/2207).
1618
- Added post-installation configuration integration test to configure SSL certificate
1719
support for SQL Server instance DSCSQLTEST in CI environment, enabling testing
1820
of encryption-related functionality. The new `PostInstallationConfiguration`
@@ -70,6 +72,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7072

7173
### Fixed
7274

75+
- `Repair-SqlDscServer`
76+
- Removed the `Features` parameter from the command as SQL Server Repair action
77+
does not accept the `/FEATURES` parameter. SQL Server automatically repairs
78+
all installed features when using the Repair action. This fixes the error
79+
"The setting 'FEATURES' is not allowed when the value of setting 'ACTION'
80+
is 'Repair'." that occurred when attempting to repair a SQL Server instance
81+
[issue #2238](https://github.com/dsccommunity/SqlServerDsc/issues/2238).
7382
- Corrected error message in test file to recommend 'noop' task instead of 'build'
7483
task for resolving dependencies
7584
([issue #2279](https://github.com/dsccommunity/SqlServerDsc/issues/2279)).

source/Private/Invoke-SetupAction.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@
421421
Upgrades the instance 'MyInstance' with the SQL Server edition that is provided by the media path.
422422
423423
.EXAMPLE
424-
Invoke-SetupAction -Repair -InstanceName 'MyInstance' -Features 'SQLENGINE' -MediaPath 'E:\'
424+
Invoke-SetupAction -Repair -InstanceName 'MyInstance' -MediaPath 'E:\'
425425
426-
Repairs the database engine of the instance 'MyInstance'.
426+
Repairs all installed features of the instance 'MyInstance'.
427427
428428
.EXAMPLE
429429
Invoke-SetupAction -RebuildDatabase -InstanceName 'MyInstance' -SqlSysAdminAccounts @('MyAdminAccount') -MediaPath 'E:\'
@@ -462,6 +462,14 @@
462462
463463
For RebuildDatabase the parameter SAPwd must be set if the instance was
464464
installed with SecurityMode = 'SQL'.
465+
466+
SQL Server Repair action does not accept the FEATURES parameter. Although
467+
Microsoft's documentation lists /FEATURES as required for the Repair action,
468+
the actual SQL Server setup executable (tested with SQL Server 2017 and
469+
SQL Server 2022) rejects this parameter with the error: "The setting
470+
'FEATURES' is not allowed when the value of setting 'ACTION' is 'Repair'."
471+
SQL Server automatically repairs all installed features during a repair
472+
operation.
465473
#>
466474
function Invoke-SetupAction
467475
{
@@ -626,7 +634,6 @@ function Invoke-SetupAction
626634

627635
[Parameter(ParameterSetName = 'Install', Mandatory = $true)]
628636
[Parameter(ParameterSetName = 'PrepareImage', Mandatory = $true)]
629-
[Parameter(ParameterSetName = 'Repair', Mandatory = $true)]
630637
[Parameter(ParameterSetName = 'Uninstall', Mandatory = $true)]
631638
[Parameter(ParameterSetName = 'InstallFailoverCluster', Mandatory = $true)]
632639
[Parameter(ParameterSetName = 'PrepareFailoverCluster', Mandatory = $true)]

source/Public/Repair-SqlDscServer.ps1

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
.PARAMETER Enu
2828
See the notes section for more information.
2929
30-
.PARAMETER Features
31-
See the notes section for more information.
32-
3330
.PARAMETER PBEngSvcAccount
3431
See the notes section for more information.
3532
@@ -55,14 +52,22 @@
5552
None.
5653
5754
.EXAMPLE
58-
Repair-SqlDscServer -InstanceName 'MyInstance' -Features 'SQLENGINE' -MediaPath 'E:\'
55+
Repair-SqlDscServer -InstanceName 'MyInstance' -MediaPath 'E:\'
5956
60-
Repairs the database engine of the instance 'MyInstance'.
57+
Repairs all installed features of the instance 'MyInstance'.
6158
6259
.NOTES
6360
The parameters are intentionally not described since it would take a lot
6461
of effort to keep them up to date. Instead there is a link that points to
6562
the SQL Server command line setup documentation which will stay relevant.
63+
64+
SQL Server Repair action does not accept the FEATURES parameter. Although
65+
Microsoft's documentation lists /FEATURES as required for the Repair action,
66+
the actual SQL Server setup executable (tested with SQL Server 2017 and
67+
SQL Server 2022) rejects this parameter with the error: "The setting
68+
'FEATURES' is not allowed when the value of setting 'ACTION' is 'Repair'."
69+
SQL Server automatically repairs all installed features during a repair
70+
operation.
6671
#>
6772
function Repair-SqlDscServer
6873
{
@@ -84,44 +89,6 @@ function Repair-SqlDscServer
8489
[System.Management.Automation.SwitchParameter]
8590
$Enu,
8691

87-
[Parameter(Mandatory = $true)]
88-
[ValidateSet(
89-
'SQL',
90-
'SQLEngine', # Part of parent feature SQL
91-
'Replication', # Part of parent feature SQL
92-
'FullText', # Part of parent feature SQL
93-
'DQ', # Part of parent feature SQL
94-
'PolyBase', # Part of parent feature SQL
95-
'PolyBaseCore', # Part of parent feature SQL
96-
'PolyBaseJava', # Part of parent feature SQL
97-
'AdvancedAnalytics', # Part of parent feature SQL
98-
'SQL_INST_MR', # Part of parent feature SQL
99-
'SQL_INST_MPY', # Part of parent feature SQL
100-
'SQL_INST_JAVA', # Part of parent feature SQL
101-
'AS',
102-
'RS',
103-
'RS_SHP',
104-
'RS_SHPWFE', # cspell: disable-line
105-
'DQC',
106-
'IS',
107-
'IS_Master', # Part of parent feature IS
108-
'IS_Worker', # Part of parent feature IS
109-
'MDS',
110-
'SQL_SHARED_MPY',
111-
'SQL_SHARED_MR',
112-
'Tools',
113-
'BC', # Part of parent feature Tools
114-
'Conn', # Part of parent feature Tools
115-
'DREPLAY_CTLR', # Part of parent feature Tools (cspell: disable-line)
116-
'DREPLAY_CLT', # Part of parent feature Tools (cspell: disable-line)
117-
'SNAC_SDK', # Part of parent feature Tools (cspell: disable-line)
118-
'SDK', # Part of parent feature Tools
119-
'LocalDB', # Part of parent feature Tools
120-
'AZUREEXTENSION'
121-
)]
122-
[System.String[]]
123-
$Features,
124-
12592
[Parameter()]
12693
[System.String]
12794
$PBEngSvcAccount,

tests/Integration/Commands/Repair-SqlDscServer.Integration.Tests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Describe 'Repair-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL201
4646
# Set splatting parameters for Repair-SqlDscServer
4747
$repairSqlDscServerParameters = @{
4848
InstanceName = 'DSCSQLTEST'
49-
Features = 'SQLENGINE'
5049
MediaPath = $env:IsoDrivePath
5150
Verbose = $true
5251
ErrorAction = 'Stop'

0 commit comments

Comments
 (0)