Skip to content

PowerShell function to support formatting output from Get-AzureStorageKey.

Notifications You must be signed in to change notification settings

azure-contrib/Format-AzureStorageKey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Usage Setup:

  • To get it defined (it is a function), currently I have it in my $profile (vim $PROFILE and add the code) - I know there are better options..
  • Before running it, make sure you have an active cert or logged in account, e.g.: Add-AzureAccount
  • Then make sure you have selected a subscription within that account with an available storage account - in the Usage section below, that account is 'pragazdiags' which you would replace with your own

Usage:

  • Get-AzureStorageKey -StorageAccountName pragazdiags | Format-AzureStorageKey
  • Get-AzureStorageKey -StorageAccountName pragazdiags | Format-AzureStorageKey -AsConnectionString
  • Get-AzureStorageKey -StorageAccountName pragazdiags | Format-AzureStorageKey -UseSecondary -UseHttp
  • Format-AzureStorageKey

Output:

  • DefaultEndpointsProtocol=https;AccountName=pragazdiags;AccountKey=9+RvXH9SeYuDyueyAtzqQ bcE52sidWQbCXoxidpn6ZROL20GFVj+Ulc3X7+GbemcWOlYK6sUycAJJqmJaQ0KnQ==
  • DefaultEndpointsProtocol=https;AccountName=pragazdiags;AccountKey=9+RvXH9SeYuDyueyAtzqQ bcE52sidWQbCXoxidpn6ZROL20GFVj+Ulc3X7+GbemcWOlYK6sUycAJJqmJaQ0KnQ==
  • DefaultEndpointsProtocol=http;AccountName=pragazdiags;AccountKey=TUzONza19iYiZvqU12W9bj
  • (an ugly error will appear here since in its current state it only works while being used in a pipeline where Get-AzureStorageKey output is piped to it)

Resources:

FAQ:

  • Why is this such a small repository - having only one function? We can rename it to something more general if more features are added, but for now it seems the best name. Didn't want to get ahead of myself. :-)

About

PowerShell function to support formatting output from Get-AzureStorageKey.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published