Open johlju opened 7 years ago
One workaround is to use the SqlServer PowerShell module.
The integration tests might need a workaround for this as well. I added this code to the integration tests I am working on. But I revert back to make sure only on SQLPS module is available for the time being.
<#
This must be done before SQLPS modules are restored. Otherwise
this could complain that the same cmdlets already exist.
This is also a workaround for having multiple SQLPS modules installed
on the AppVeyor build worker (see issue #806).
#>
Write-Verbose -Message 'Installing SqlServer PowerShell module.' -Verbose
Install-Module -Name SqlServer -Force
Details of the scenario you tried and the problem that is occurring: Enable AlwaysOn fails to configure SQL Server 2016 when both SQL Server 2014 and SQL Server 2016 is installed and having SQLPS module installed for both major version. The reason is that sometimes the wrong SQLPS module is loaded (because it is the first in the
$env:PATH
list).The DSC configuration that is using the resource (as detailed as possible):
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running: Windows Server 2016, SQL Server 2014 and 2016, WMF 5.1
What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running: SQLPS
Version of the DSC module you're using, or 'dev' if you're using current dev branch: Dev