You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although ReadOnlyRoutingList gets set properly, if you run the code a second time you get this result.
VERBOSE: [CHWK01]: LCM: [ Start Test ] [[SqlAGReplica]SEC1N1]
VERBOSE: [CHWK01]: [[SqlAGReplica]SEC1N1] Importing the module MSFT_SqlAGReplica in force mode.
VERBOSE: [CHWK01]: [[SqlAGReplica]SEC1N1] Importing the module MSFT_SqlAGReplica in force mode.
VERBOSE: [CHWK01]: [[SqlAGReplica]SEC1N1] Preferred module SqlServer found.
VERBOSE: [CHWK01]: [[SqlAGReplica]SEC1N1] Importing PowerShell module 'SqlServer' with version '21.0.17279' from path 'C:\Program Files\WindowsPowerShell\Modules\SqlServer\SqlServer.psm1'.
VERBOSE: [CHWK01]: [[SqlAGReplica]SEC1N1] Connected to SQL instance 'SEC1N1'.
VERBOSE: [CHWK01]: [[SqlAGReplica]SEC1N1] 2019-03-14_00-14-48: 'ReadOnlyRoutingList' should be 'SEC1N2 SEC1N3' but is 'SEC1N2 SEC1N3'
It will trigger Set again, which does nothing, and so never reaches desired state.
Suggested solution to the issue
In the Test code there's a -ne comparison which isn't valid for the ReadOnlyRoutingList being a string array (it's the only one).
if ( $getTargetResourceResult.($parameterName) -ne $parameterValue )
{
New-VerboseMessage -Message "'$($parameterName)' should be '$($parameterValue)' but is '$($getTargetResourceResult.($parameterName))'"
$result = $False
}
To fix this the ReadOnlyRoutingList parameter can have an explicit different case that uses a string join with commas instead of the -ne comparison. That's how it's done in the Set portion and that bit is working great.
Version of the DSC module that was used ('dev' if using current dev branch)
dev
The text was updated successfully, but these errors were encountered:
codykonior
changed the title
SqlAGReplica: Test method doesn't check ReadOnlyRoutingList properly
SqlAGReplica: Test doesn't check ReadOnlyRoutingList properly
Mar 13, 2019
johlju
added
enhancement
The issue is an enhancement request.
help wanted
The issue is up for grabs for anyone in the community.
in progress
The issue is being actively worked on by someone.
and removed
help wanted
The issue is up for grabs for anyone in the community.
labels
Mar 13, 2019
Details of the scenario you tried and the problem that is occurring
Although ReadOnlyRoutingList gets set properly, if you run the code a second time you get this result.
It will trigger Set again, which does nothing, and so never reaches desired state.
Suggested solution to the issue
In the Test code there's a -ne comparison which isn't valid for the ReadOnlyRoutingList being a string array (it's the only one).
To fix this the ReadOnlyRoutingList parameter can have an explicit different case that uses a string join with commas instead of the -ne comparison. That's how it's done in the Set portion and that bit is working great.
Version of the DSC module that was used ('dev' if using current dev branch)
dev
The text was updated successfully, but these errors were encountered: