Skip to content

Instantly share code, notes, and snippets.

@elringus
Last active January 15, 2016 20:07
Show Gist options
  • Save elringus/a025a92eaae265558ca2 to your computer and use it in GitHub Desktop.
Save elringus/a025a92eaae265558ca2 to your computer and use it in GitHub Desktop.
A power shell scripts to batch-add end-points to an Azure VM.
Add-AzureAccount
$vm = Get-AzureVM -ServiceName "example-service-name" -Name "example-vm-name"
for ($i=7000; $i -le 7100; $i++)
{
$EndpointName = "EXAMPLE-"
$EndpointName += $i
Add-AzureEndpoint -Name $EndpointName -Protocol "udp" -PublicPort $i -LocalPort $i -VM $vm
}
$vm | Update-AzureVM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment