dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
360 stars 227 forks source link

SqlAGReplica: Enforce `EnpointHostName` even though it is not part of the configuration #1821

Closed johlju closed 1 year ago

johlju commented 1 year ago

Problem description

The resource wrongly try to enforce EndpointHostName even though it is not part of the configuration. When not passed in the configuration EndpointHostname will be matched against empty string which will always be wrong.

Verbose logs

Not available

DSC configuration

Found when converting unit test to Pester 5.

Suggested solution

Evaluate that the the parameter EndpointHostname was passed in the configuration.

https://github.com/dsccommunity/SqlServerDsc/blob/d5692e24b3b6303556729639cbb0b2a6763198af/source/DSCResources/DSC_SqlAGReplica/DSC_SqlAGReplica.psm1#L730

SQL Server edition and version

n/a

SQL Server PowerShell modules

n/a

Operating system

n/a

PowerShell version

n/a

SqlServerDsc version

main branch