-
Notifications
You must be signed in to change notification settings - Fork 229
SqlRSSetup
: Refactor resource into class-based resource
#2083
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
Conversation
#> | ||
if ($this.ForceRestart -or ($exitCode -eq 3010 -and -not $this.SuppressRestart)) | ||
{ | ||
$global:DSCMachineStatus = 1 |
Check warning
Code scanning / PSScriptAnalyzer
Found global variable 'global:DSCMachineStatus'. Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
{ | ||
$errorMessage = $script:localizedData.Get_FileProductVersion_GetFileProductVersionError -f $Path, $_.Exception.Message | ||
|
||
Write-Error -Message $errorMessage -ErrorAction 'Stop' |
Check warning
Code scanning / PSScriptAnalyzer
Write-Error is used to create a terminating error. throw or $pscmdlet.ThrowTerminatingError should be used. Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Stuff left to do:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2083 +/- ##
====================================
- Coverage 94% 94% -1%
====================================
Files 105 107 +2
Lines 8114 8104 -10
====================================
- Hits 7689 7667 -22
- Misses 425 437 +12
🚀 New features to boost your workflow:
|
0a1f8c9
to
e1ffe69
Compare
@@ -21,7 +21,7 @@ | |||
SqlRSSetup 'InstallDefaultInstance' | |||
{ | |||
InstanceName = 'SSRS' | |||
IAcceptLicenseTerms = 'Yes' | |||
AcceptLicenseTerms = $true |
Check failure
Code scanning / PSScriptAnalyzer
The member 'IAcceptLicenseTerms' is not valid. Valid members are 'AcceptLicensingTerms', 'Action', 'DependsOn', 'Edition', 'EditionUpgrade', 'ForceRestart', 'InstallFolder', 'InstanceName', 'LogPath', 'MediaPath', 'ProductKey', 'PsDscRunAsCredential', 'SuppressRestart', 'Timeout', 'VersionUpgrade'. Error
'AcceptLicensingTerms', 'Action', 'DependsOn', 'Edition', 'EditionUpgrade', 'ForceRestart', 'InstallFolder', 'InstanceName', 'LogPath', 'MediaPath', 'ProductKey', 'PsDscRunAsCredential', 'SuppressRestart', 'Timeout', 'VersionUpgrade'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -25,7 +25,7 @@ | |||
Action = 'Uninstall' | |||
|
|||
# This needs to be set to although it is not used during uninstall. | |||
IAcceptLicenseTerms = 'Yes' | |||
AcceptLicenseTerms = $true |
Check failure
Code scanning / PSScriptAnalyzer
The member 'IAcceptLicenseTerms' is not valid. Valid members are 'AcceptLicensingTerms', 'Action', 'DependsOn', 'Edition', 'EditionUpgrade', 'ForceRestart', 'InstallFolder', 'InstanceName', 'LogPath', 'MediaPath', 'ProductKey', 'PsDscRunAsCredential', 'SuppressRestart', 'Timeout', 'VersionUpgrade'. Error
'AcceptLicensingTerms', 'Action', 'DependsOn', 'Edition', 'EditionUpgrade', 'ForceRestart', 'InstallFolder', 'InstanceName', 'LogPath', 'MediaPath', 'ProductKey', 'PsDscRunAsCredential', 'SuppressRestart', 'Timeout', 'VersionUpgrade'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
b0607da
to
68b6ea0
Compare
bfe2417
to
90868af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 25 files at r1, 3 of 7 files at r2, 2 of 26 files at r3, 35 of 36 files at r4, all commit messages.
Reviewable status: 45 of 46 files reviewed, 19 unresolved discussions (waiting on @Github-advanced-security[bot] and @johlju)
tests/Integration/Resources/DSC_SqlRSSetup.config.ps1
line 22 at r4 (raw file):
InstanceName = if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_PowerBI') { 'PBIRS' # cSpell:ignore PBIRS
Add this spelling to the settings.json
?
Code quote:
# cSpell:ignore PBIRS
source/en-US/SqlRSSetup.strings.psd1
line 0 at r4 (raw file):
Do these need a string code e.g. SRSET0001?
source/Private/Get-FileProductVersion.ps1
line 0 at r4 (raw file):
Seems generic enough to be a candidate for moving to DscResource.Common?
tests/Unit/Public/ConvertTo-SqlDscEditionName.Tests.ps1
line 13 at r4 (raw file):
{ # Redirect all streams to $null, except the error stream (stream 2) & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 2>&1 4>&1 5>&1 6>&1 > $null
Again, redirecting error stream 2.
tests/Unit/Public/ConvertTo-SqlDscEditionName.Tests.ps1
line 52 at r4 (raw file):
Context 'When converting a known EditionId' { BeforeAll { $mockLocalizedConvertingEditionId = InModuleScope -ScriptBlock {
Is the variable used anywhere?
Also, no Set-StrictMode
.
tests/Unit/Private/Get-FileProductVersion.Tests.ps1
line 13 at r4 (raw file):
{ # Redirect all streams to $null, except the error stream (stream 2) & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 2>&1 4>&1 5>&1 6>&1 > $null
Error stream.
.vscode/analyzersettings.psd1
line 36 at r4 (raw file):
'PSUseCmdletCorrectly' 'PSUseOutputTypeCorrectly' #'PSAvoidGlobalVars'
Should this be re-enabled and a local supress statement used?
source/Public/ConvertTo-SqlDscEditionName.ps1
line 82 at r4 (raw file):
EditionName = 'Unknown' } }
Could this be a switch statement? $mappingID
is not used anywhere else.
Code quote:
if ($EditionIdMap.ContainsKey($mappingID))
{
$editionInfo = $EditionIdMap[$mappingID]
$resultObject = [PSCustomObject]@{
EditionId = $Id
Edition = $editionInfo.Edition
EditionName = $editionInfo.EditionName
}
return $resultObject
}
else
{
Write-Debug -Message ($script:localizedData.ConvertTo_EditionName_UnknownEditionId -f $Id)
return [PSCustomObject]@{
EditionId = $Id
Edition = 'Unknown'
EditionName = 'Unknown'
}
}
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 0 at r4 (raw file):
Missing Set-StrictMode -Version 1.0
in all InModuleScope
blocks
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 19 at r4 (raw file):
{ # Redirect all streams to $null, except the error stream (stream 2) & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 2>&1 4>&1 5>&1 6>&1 > $null
This should be 3 I believe.
Code quote:
2
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 1041 at r4 (raw file):
It 'Should throw the correct error message' { InModuleScope -ScriptBlock { $mockExpectedErrorMessage = ($script:mockSqlRSSetupInstance.localizedData.InstanceName_Invalid -f 'INSTANCE') + ' (Parameter ''InstanceName'')'
Does Get-InvalidArgumentRecord
not work?
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 1070 at r4 (raw file):
It 'Should throw the correct error message' { InModuleScope -ScriptBlock { $mockExpectedErrorMessage = $script:mockSqlRSSetupInstance.localizedData.AcceptLicensingTerms_Required + ' (Parameter ''AcceptLicensingTerms'')'
And here?
source/Classes/020.SqlRSSetup.ps1
line 173 at r4 (raw file):
[ValidateSet('Install', 'Repair', 'Uninstall')] [System.String] $Action
Can this use an Enum? It can be reused in other install resources?
Code quote:
[DscProperty(Mandatory)]
[ValidateSet('Install', 'Repair', 'Uninstall')]
[System.String]
$Action
source/Classes/020.SqlRSSetup.ps1
line 194 at r4 (raw file):
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')] [System.String] $Edition
Same here too.
Code quote:
[DscProperty()]
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')]
[System.String]
$Edition
f53e58e
to
2da5ea0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 40 of 46 files reviewed, 19 unresolved discussions (waiting on @dan-hughes)
.vscode/analyzersettings.psd1
line 36 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Should this be re-enabled and a local supress statement used?
I tried, but I could not find a way to make a local suppress statement for it, do you have a suggestion how to make one?
source/Classes/020.SqlRSSetup.ps1
line 173 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Can this use an Enum? It can be reused in other install resources?
Done. The enum should probably be reused in the public commands as well, but have to be another PR to fix that.
source/Classes/020.SqlRSSetup.ps1
line 194 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Same here too.
Done. Not sure if it would benefit anything as it would be ReportServerEdition
and would only be used in this resource. Bu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 39 of 48 files reviewed, 19 unresolved discussions (waiting on @dan-hughes)
source/Classes/020.SqlRSSetup.ps1
line 194 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Done. Not sure if it would benefit anything as it would be
ReportServerEdition
and would only be used in this resource. Bu
Forgot to write the last sentence. :) But if it would be used by commands as well, then there is a benefit, assuming we can resolve the commands in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 39 of 48 files reviewed, 18 unresolved discussions (waiting on @dan-hughes)
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 19 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
This should be 3 I believe.
Done.
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 1041 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Does
Get-InvalidArgumentRecord
not work?
Done. Yes, forgot about that command.
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line 1070 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
And here?
Done. Fixed throughout.
tests/Unit/Classes/SqlRSSetup.Tests.ps1
line at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Missing
Set-StrictMode -Version 1.0
in allInModuleScope
blocks
Done. Fix in all InModuleScope inside It-block.
tests/Unit/Public/ConvertTo-SqlDscEditionName.Tests.ps1
line 13 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Again, redirecting error stream 2.
Done.
tests/Unit/Public/ConvertTo-SqlDscEditionName.Tests.ps1
line 52 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Is the variable used anywhere?
Also, no
Set-StrictMode
.
Done. Removed unnecessary lines. Public command - testing actually exported command, so no InModuleScope to run Set-StrictMode in.
source/Private/Get-FileProductVersion.ps1
line at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Seems generic enough to be a candidate for moving to DscResource.Common?
Done. Moved and removed here.
tests/Unit/Private/Get-FileProductVersion.Tests.ps1
line 13 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Error stream.
Done. Test removed, moved command to DscResource.Common.
{ | ||
$errorMessage = $script:localizedData.Get_FileProductVersion_GetFileProductVersionError -f $Path, $_.Exception.Message | ||
|
||
Write-Error -Message $errorMessage -ErrorAction 'Stop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @dan-hughes from a discussion.
Reviewable status: 38 of 48 files reviewed, 17 unresolved discussions (waiting on @dan-hughes)
source/en-US/SqlRSSetup.strings.psd1
line at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Do these need a string code e.g. SRSET0001?
Done.
source/Public/ConvertTo-SqlDscEditionName.ps1
line 82 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Could this be a switch statement?
$mappingID
is not used anywhere else.
Do you mean to also remove $EditionIdMap
and move each object to be returned in switch-block?
tests/Integration/Resources/DSC_SqlRSSetup.config.ps1
line 22 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Add this spelling to the
settings.json
?
Done.
#> | ||
if ($this.ForceRestart -or ($exitCode -eq 3010 -and -not $this.SuppressRestart)) | ||
{ | ||
$global:DSCMachineStatus = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -21,7 +21,7 @@ | |||
SqlRSSetup 'InstallDefaultInstance' | |||
{ | |||
InstanceName = 'SSRS' | |||
IAcceptLicenseTerms = 'Yes' | |||
AcceptLicenseTerms = $true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -25,7 +25,7 @@ | |||
Action = 'Uninstall' | |||
|
|||
# This needs to be set to although it is not used during uninstall. | |||
IAcceptLicenseTerms = 'Yes' | |||
AcceptLicenseTerms = $true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@dan-hughes I have finally had the time to handle the review comments, I hope I fixed most but need input on a couple, when you have time 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 8 files at r5, 7 of 7 files at r6, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @johlju)
.vscode/analyzersettings.psd1
line 36 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
I tried, but I could not find a way to make a local suppress statement for it, do you have a suggestion how to make one?
I'm assuming you can do what is done in test files and add [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '')]
?
It just seemed a little overkill disabling the check across the whole module.
source/Public/ConvertTo-SqlDscEditionName.ps1
line 82 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Do you mean to also remove
$EditionIdMap
and move each object to be returned in switch-block?
Yes. Something like this:
$resultObject = [PSCustomObject]@{
EditionId = $Id
Edition = ''
EditionName = ''
}
Write-Debug -Message ($script:localizedData.ConvertTo_EditionName_ConvertingEditionId -f $Id)
switch ($Id) {
2176971986 {
$resultObject.Edition = 'Developer'
$resultObject.EditionName = 'SQL Server Developer Edition'
}
2017617798 {
$resultObject.Edition = 'Developer'
$resultObject.EditionName = 'Power BI Report Server - Developer'
}
1369084056 {
$resultObject.Edition = 'Evaluation'
$resultObject.EditionName = 'Power BI Report Server - Evaluation'
}
default {
Write-Debug -Message ($script:localizedData.ConvertTo_EditionName_UnknownEditionId -f $Id)
$resultObject.Edition = 'Unknown'
$resultObject.EditionName = 'Unknown'
}
}
return $resultObject
Are the strings localized?
a15d5cd
to
5e6e619
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 46 of 49 files reviewed, 6 unresolved discussions (waiting on @dan-hughes)
.vscode/analyzersettings.psd1
line 36 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
I'm assuming you can do what is done in test files and add
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '')]
?It just seemed a little overkill disabling the check across the whole module.
I can't make it work as it is normally put above a param ()
, and I can't add that to a class script file as the param ()
will be added to the built module. I tried to add it in different places in a class to see that it worked but couldn't get anything to work. Not sure if the SuppressMessageAttribute
is supported for classes. 🤔
So, I disable the rule as that was the only workaround I could think of. It was not my desire, and rather would like to find another solution if possible.
source/Public/ConvertTo-SqlDscEditionName.ps1
line 82 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Yes. Something like this:
$resultObject = [PSCustomObject]@{ EditionId = $Id Edition = '' EditionName = '' } Write-Debug -Message ($script:localizedData.ConvertTo_EditionName_ConvertingEditionId -f $Id) switch ($Id) { 2176971986 { $resultObject.Edition = 'Developer' $resultObject.EditionName = 'SQL Server Developer Edition' } 2017617798 { $resultObject.Edition = 'Developer' $resultObject.EditionName = 'Power BI Report Server - Developer' } 1369084056 { $resultObject.Edition = 'Evaluation' $resultObject.EditionName = 'Power BI Report Server - Evaluation' } default { Write-Debug -Message ($script:localizedData.ConvertTo_EditionName_UnknownEditionId -f $Id) $resultObject.Edition = 'Unknown' $resultObject.EditionName = 'Unknown' } } return $resultObjectAre the strings localized?
Got you, will fix tomorrow. Hmm, they should probably be localized, guessing a Spanish SQL Server actually have Spanish names returned. 🤔 Fixing that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r7, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @johlju)
.vscode/analyzersettings.psd1
line 36 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
I can't make it work as it is normally put above a
param ()
, and I can't add that to a class script file as theparam ()
will be added to the built module. I tried to add it in different places in a class to see that it worked but couldn't get anything to work. Not sure if theSuppressMessageAttribute
is supported for classes. 🤔So, I disable the rule as that was the only workaround I could think of. It was not my desire, and rather would like to find another solution if possible.
Leave it and create an issue for it? I'll have a play about with it next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @dan-hughes)
.vscode/analyzersettings.psd1
line 36 at r4 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Leave it and create an issue for it? I'll have a play about with it next week.
Done. It did work using Set-Variable
to set the global variable, which the rule ignored. But then I remembered we have a function Set‑DscMachineRebootRequired
in DscResource.Common, so changed to that.
source/Classes/020.SqlRSSetup.ps1
line 191 at r7 (raw file):
[DscProperty()] [ReportServerEdition] $Edition
Having an enum here really complicates things as it is optional. Get-DscProperty
will return it as a property that are set even if it is not as it will be set to the default value 0 if not set. Assert-BoundParameters
will always see Edition being set as it defaults to 0.
I will revert this to ValidateSet()
- having an enum is not worth the extra code needed... for now. I think more work need to be done to handle enums this way. 🤔
Code quote:
[ReportServerEdition]
$Edition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 46 of 49 files reviewed, 7 unresolved discussions (waiting on @dan-hughes)
source/Public/ConvertTo-SqlDscEditionName.ps1
line 82 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Got you, will fix tomorrow. Hmm, they should probably be localized, guessing a Spanish SQL Server actually have Spanish names returned. 🤔 Fixing that too.
Done.
It shouldn't do. You have enabled the feature flag which removes any Enum's with a zero value in |
@dan-hughes now all review comments should be resolved. I hade to revert the enum on the optional parameter, see comment. Not sure how to solve commands in DscResource.Base other than passing in a new parameter that switches behavior. 🤔 Anyway, I think that work is out of scope for this PR. 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 44 of 49 files reviewed, 7 unresolved discussions (waiting on @dan-hughes)
source/Classes/020.SqlRSSetup.ps1
line 191 at r7 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
It shouldn't do. You have enabled the feature flag which removes any Enum's with a zero value in
GetDesiredState
before being passed intoAssertProperties
.
Correct, checked now an Assert-BoundParameters
should work in AssertProperties().
So it is only this line that does not work for this particular resource as it is getting the settings from the current instance to send to the public command.
SqlServerDsc/source/Classes/020.SqlRSSetup.ps1
Lines 433 to 434 in 92c6b95
$commandParameters = $this | | |
Get-DscProperty @getDscPropertyParameters |
For that to work I would have to remove the Edition parameter if set to 0 after the call to Edition
. I just don't see the benefit of having all the extra code just to have an enum 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 44 of 49 files reviewed, 7 unresolved discussions (waiting on @dan-hughes)
source/Classes/020.SqlRSSetup.ps1
line 191 at r7 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Correct, checked now an
Assert-BoundParameters
should work in AssertProperties().So it is only this line that does not work for this particular resource as it is getting the settings from the current instance to send to the public command.
SqlServerDsc/source/Classes/020.SqlRSSetup.ps1
Lines 433 to 434 in 92c6b95
$commandParameters = $this | Get-DscProperty @getDscPropertyParameters For that to work I would have to remove the Edition parameter if set to 0 after the call to
Edition
. I just don't see the benefit of having all the extra code just to have an enum 🤔
I meant to say... after the call to Get-dscProperty
. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 44 of 49 files reviewed, 7 unresolved discussions (waiting on @dan-hughes)
source/Classes/020.SqlRSSetup.ps1
line 191 at r7 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
I meant to say... after the call to
Get-dscProperty
. 🙂
We could extend Get-DscProperty
with a switch parameter -IgnoreZeroEnumValue
. But rather not do it for this PR. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r8, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @johlju)
source/Classes/020.SqlRSSetup.ps1
line 191 at r7 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
We could extend
Get-DscProperty
with a switch parameter-IgnoreZeroEnumValue
. But rather not do it for this PR. 🙂
Move private function Clear-ZeroedEnumPropertyValue
from .Base into .Common or just make it public as an option?
source/Classes/020.SqlRSSetup.ps1
line 237 at r8 (raw file):
) $this.FeatureOptionalEnums = $true
This can now be removed as no optional Enums.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @johlju)
source/Classes/020.SqlRSSetup.ps1
line 191 at r7 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Move private function
Clear-ZeroedEnumPropertyValue
from .Base into .Common or just make it public?
Since .Base imports DscResource.Common, we could move it to DscResource.Common 🤔 If we make it public in Base then we need to import that as well in each modules prefix.ps1. 🤔 Best option might be moving it to Common. 🤔
Also added the issue: dsccommunity/DscResource.Common#150
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 48 of 49 files reviewed, 5 unresolved discussions (waiting on @dan-hughes)
source/Classes/020.SqlRSSetup.ps1
line 237 at r8 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
This can now be removed as no optional Enums.
Done.
There was a problem hiding this 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 r9, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @johlju)
Added issue #2101 to track re-adding the enum in the future. 🙂 |
Pull Request (PR) description
SourcePath
was replaced withMediaPath
.IAcceptLicensTerms
was replaced with a boolean parameterAcceptLicensingTerms
.SourceCredential
was removed. Because of this, thefunctionality that allowed copying the media from a UNC path using
those credentials was also removed. If this was something you used,
please open an issue.
installed package (using
Get-Package
), but instead from the registry.were any pending rename operations. Since the install returns 3010
if a restart is needed it is now assumed that the setup process takes
care of this. If that is not the case, and this check is needed, then
open an issue to discuss in what cases this is needed.
Edition
optionDevelopment
was replaced by the valueDeveloper
.CurrentVersion
,ServiceName
andErrorDumpDirectory
were removed.
ConvertTo-SqlDscEditionName
to return the edition name of the specifiededition ID.
This Pull Request (PR) fixes the following issues
SqlRSSetup
: Refactor resource #2068Partly handles #1351
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
This change is