Skip to content

Instantly share code, notes, and snippets.

@karolikl
Created February 17, 2015 12:01
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 karolikl/a7be56be079f2ea624d6 to your computer and use it in GitHub Desktop.
Save karolikl/a7be56be079f2ea624d6 to your computer and use it in GitHub Desktop.
Add server to Network Load Balancer
Import-Module NetworkLoadBalancingClusters
function Start-Node(){
$nodeName = $OctopusParameters['NLBNodeName'];
Write-Host "Starting node with name: $nodeName"
$nodeResult = Start-NlbClusterNode $nodeName
$state = $nodeResult.State.ToString()
Write-Host "State of $nodeName is $state"
if ($state.ToString() -NotMatch "converged"){
Write-Error "Node is still stopped, manual intervention is needed..."
}
Write-Host "Successfully started $nodeName"
}
Start-Node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment