Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function Remove-LoadBalancerDebuggerNatPools
Write-Information "Removing NAT pools with 'debugger' in the name from load balancer $LoadBalancerName"
$loadBalancer = Get-AzureRmLoadBalancer -Name $LoadBalancerName -ResourceGroupName $resourceGroupName
$pools = $loadBalancer.InboundNatPools | Where-Object { $_.Name -match "debugger" }
foreach ($pool in $pools) {
if ($pools.Count -lt 0)
Write-Information "Updating $LoadBalancerName to save the changes"
Set-AzureRmLoadBalancer -LoadBalancer $loadBalancer
else {
Write-Information "Skipping updates on $LoadBalancerName, no debugger pools found."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.