Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Created October 8, 2018 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mczerniawski/a0f8de3dedf47430ec46f257f64dacde to your computer and use it in GitHub Desktop.
Save mczerniawski/a0f8de3dedf47430ec46f257f64dacde to your computer and use it in GitHub Desktop.
switch (Compare-Object -ReferenceObject @($nodesInCluster) -DifferenceObject @($PreferredOwner) -IncludeEqual ) {
{$PSItem.SideIndicator -eq '=>'} {
Write-Error -Message "Given preferred owner {$($PSItem.InputObject)} not found in nodes of cluster {$Cluster}. Aborting" -ErrorAction Stop
break
}
{$PSItem.SideIndicator -eq '=='} {
Write-Verbose -Message "Given preferred owner {$($PSItem.InputObject)} was found in nodes of cluster {$Cluster}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment