Love to get some feedback on this..

Welcome Forums General PowerShell Q&A Love to get some feedback on this..

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 2 months ago.

  • Author
  • #60211

    Points: 0
    Rank: Member


    Working hard on my PowerShell skills and really enjoying myself in de process. But I was figuring out this one-liner today and thought that this was maybe a bit complicated and should be able to do this easier. So this is why I thought to post my "creation" here.. Again, it's nothing fancy, but I accomplished my goal and just want to know if there was a easier way on doing this..

    So here is my "one-liner" The idea is that I wanted to put my StorageAccountKey in a variable which I then can use. But the hard thing (for me) was to get only the first key, you het two keys when you use the Get-AzureRmStorageAccountkey cmdlet.

    $StorageKey = (Get-AzureRmStorageAccountkey -ResourceGroupName "ResourceGroup" -Name "storageaccount").value | select -First 1

    Like I said, would love to get some feedback on this.

  • #60213

    Points: 17
    Rank: Member
    # For Azure PowerShell version 1.4, and later versions
    $StorageKey = (Get-AzureRmStorageAccountkey -ResourceGroupName "ResourceGroup" -Name "storageaccount").value[0]
    # For Azure PowerShell version 1.3.2, and previous versions
    $StorageKey = (Get-AzureRmStorageAccountkey -ResourceGroupName "ResourceGroup" -Name "storageaccount").Key1

The topic ‘Love to get some feedback on this..’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort