[英]Azure Powershell to copy azure storage account to another azure storage account
[英]Query Azure Storage Account metrics from Azure Powershell
Azure和Powershell的新功能。 我使用以下腳本連接到我的Azure訂閱和存儲帳戶。
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
我想立即查詢存儲帳戶:
這可能來自Azure Powershell嗎?
謝謝。
獲取容器數量
(Get-AzureStorageContainer).Count
獲取容器中的blob數量
(Get-AzureStorageBlob -Container "ContainerName").Count
不確定您是希望每個文件的文件大小還是聚合大小。
可以使用Get-AzureStorageBlob -Container "ContainerName"
顯示單個文件大小,其中列出了每個blob的Length
屬性。 Length
是以字節為單位的blob大小。
這樣做可以檢索文件總大小
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") }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.