VirtualRW

My feedback

  1. 160 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Scripting and Command Line Tools » Powershell  ·  Flag idea as inappropriate…  ·  Admin →

    We will see whether there is a way to do this with the Current Windows Azure PowerShell and if not, what it would take to provide such functionality.

    An error occurred while saving the comment
    VirtualRW commented  · 

    function Find-AllEndPoints
    {
    [CmdletBinding()]

    Param
    (
    # Param to get the subscription to use
    [Parameter(Mandatory=$true,
    HelpMessage = "Enter Subscription Name or leave empty to use default subscription")]
    [AllowEmptyString()]
    [string]$SubscriptionaName
    )

    Begin
    {
    # Will change default subscription to what user entered
    if ($subscriptionaname)
    {
    # This will capture the user current default subscription name
    $currentdefaulsub = Get-AzureSubscription -Default
    $currentsubname = $currentdefaulsub.SubscriptionName

    # This will set the default subscription to what the user inputed - if not left blank
    Set-AzureSubscription -DefaultSubscription $subscriptionaname
    }
    }

    Process
    {
    #Gets all the Services in the subscription
    $allservices = Get-AzureService

    foreach ($allservices in $allservices)
    {
    Write $allservices.servicename
    Get-AzureVM -ServiceName $allservices.servicename | ft -Property IpAddress, Powerstate -AutoSize
    get-azurevm -ServiceName $allservices.servicename | Get-AzureEndpoint | ft -Property localport, name, port, protocol -AutoSize
    }
    }
    End
    {

    }
    }

Feedback and Knowledge Base