Creating Port Range in Azure VM

Creating a port range on azure VM
$vm = Get-AzureVM -ServiceName "MEDNIT-CP" -Name "MEDNIT-CP" ; 30000..35000 | ForEach { $VM | Add-AzureEndpoint -Name EndpointPort$_ -Protocol TCP -LocalPort $_ -PublicPort $_} ; $vm | Update-AzureVM