Query Azure Storing Credentials from Azure Powershell

New for Azure and Powershell. I used the following script to connect to my Azure subscription and storage account.

Import-Module "C:\Program Files (x86)\Microsoft SDKs\WindowsAzure\PowerShell\Azure\Azure.psd1"
Import-AzurePublishSettingsFile 'C:\AZURE_POWERSHELL\DETAILS.publishsettings'
Set-AzureSubscription -SubscriptionName subname -CurrentStorageAccount storagename
Select-AzureSubscription -SubscriptionName subname

I want to request a vault account now:

  • Count the number of containers in Blob.
  • Count the number of documents in these containers.
  • Returns the file storage size of all documents.
  • Return the size of the document file store with the specified date range.

Is this possible from Azure Powershell?

Thank.

+4
source share
1 answer

Get the number of containers

(Get-AzureStorageContainer).Count

Get the number of blocks in the container

(Get-AzureStorageBlob -Container "ContainerName").Count

Not sure if you want the file size for each individual file or its size.

Get-AzureStorageBlob -Container "ContainerName", Length . Length - .

,

Get-AzureStorageBlob -Container "ContainerName" | %{ $_.Length } | measure -Sum

, ,

Get-AzureStorageBlob -Container "ContainerName" | where { $_.LastModified -gt (Get-Date -Date "specific date") -and $_.LastModified -lt (Get-Date -Date "specific date") }
+4

All Articles