Details of the scenario you tried and the problem that is occurring
I'm creating a cluster on Server 2012 but the cluster creation fails with an error that -Force is an invalid argument. This is because there's a code path that uses New-Cluster -Force and that argument isn't available in Server 2012.
Verbose logs showing the problem
Suggested solution to the issue
In DSCResources\MSFT_xCluster\MSFT_xCluster.psm1 instead of setting Force = $true while building the hashtable for splatting, check whether that parameter is valid or not first.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
...
if ($node.Role -eq "FirstClusterNode") {
xCluster "Cluster" {
Name = "C1"
DomainAdministratorCredential = $domainAdministrator
StaticIPAddress = "10.0.0.21/24"
# If RSAT-Clustering is not installed the cluster can not be created
DependsOn = "[WindowsFeature]FailoverClustering", "[WindowsFeature]RSATClustering", "[Computer]Name"
}
} else {
The operating system the target node is running
Windows Server 2012 Standard Evaluation (no patches).
Version and build of PowerShell the target node is running
WMF 5.1
Version of the DSC module that was used ('dev' if using current dev branch)
Details of the scenario you tried and the problem that is occurring
I'm creating a cluster on Server 2012 but the cluster creation fails with an error that -Force is an invalid argument. This is because there's a code path that uses New-Cluster -Force and that argument isn't available in Server 2012.
Verbose logs showing the problem
Suggested solution to the issue
In DSCResources\MSFT_xCluster\MSFT_xCluster.psm1 instead of setting Force = $true while building the hashtable for splatting, check whether that parameter is valid or not first.
This allows cluster setup to complete for me.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Windows Server 2012 Standard Evaluation (no patches).
Version and build of PowerShell the target node is running
WMF 5.1
Version of the DSC module that was used ('dev' if using current dev branch)
1.10.0.0