你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzRmStorageShare
获取或列出存储文件共享。
语法
Get-AzRmStorageShare
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
[-Name <String>]
[-SnapshotTime <DateTime>]
[-GetShareUsage]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRmStorageShare
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
[-IncludeDeleted]
[-IncludeSnapshot]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRmStorageShare
-StorageAccount <PSStorageAccount>
-Name <String>
[-SnapshotTime <DateTime>]
[-GetShareUsage]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRmStorageShare
-StorageAccount <PSStorageAccount>
[-IncludeDeleted]
[-IncludeSnapshot]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRmStorageShare
[-ResourceId] <String>
[-GetShareUsage]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzRmStorageShare cmdlet 获取或列出存储文件共享。
示例
示例 1:使用存储帐户名称和共享名称获取存储文件共享
Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes
---- -------- ---------------- ---------- ------- ------- ---------------
myshare 5120
此命令获取具有存储帐户名称和共享名称的存储文件共享。
示例 2:列出存储帐户的所有存储文件共享
Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes
---- -------- ---------------- ---------- ------- ------- ---------------
share1 5120 TransactionOptimized
share2 5120 TransactionOptimized
此命令列出存储帐户的所有存储文件共享,其中包含存储帐户名称。
示例 3:获取包含存储帐户对象和容器名称的存储 Blob 容器。
Get-AzStorageAccount -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | Get-AzRmStorageShare -Name "myshare"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes
---- -------- ---------------- ---------- ------- ------- ---------------
myshare 5120
此命令获取包含存储帐户对象和容器名称的存储 Blob 容器。
示例 4:获取包含共享使用情况的存储文件共享(以字节为单位)
Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -GetShareUsage
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes
---- -------- ---------------- ---------- ------- ------- ---------------
myshare 5120 2097152
此命令获取包含存储帐户名称和共享名称的存储文件共享,并包含共享使用情况(以字节为单位)。
示例 5:列出存储帐户的所有存储文件共享,包括已删除的共享,包括共享快照
Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -IncludeDeleted -IncludeSnapshot
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes snapshotTime
---- -------- ---------------- ---------- ------- ------- --------------- ------------
testshare1 5120 TransactionOptimized 2021-05-10T08:04:08Z
testshare1 5120 TransactionOptimized
share1 100 TransactionOptimized True 01D61FD1FC5498B6
此命令列出所有存储文件共享,包括已删除的共享和共享快照。
示例 6:获取单个共享快照
Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "testshare1" -SnapshotTime "2021-05-10T08:04:08Z"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes snapshotTime
---- -------- ---------------- ---------- ------- ------- --------------- ------------
testshare1 5120 TransactionOptimized 2021-05-10T08:04:08Z
此命令获取具有共享名称和快照时间的单个文件共享快照。
示例 7:使用筛选器列出存储帐户的存储文件共享
Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Filter "startswith(name, test)"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount
Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes snapshotTime
---- -------- ---------------- ---------- ------- ------- --------------- ------------
testshare1 5120 SMB TransactionOptimized
testshare2 5120 SMB TransactionOptimized
此命令列出名称以“test”开头的所有存储文件共享。
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Filter
共享名称的筛选器。 指定后,将仅列出以筛选器开头的共享名称。 筛选器的格式必须为:startswith(name,<prefix>
)
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GetShareUsage
指定此参数以获取共享使用情况(以字节为单位)。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IncludeDeleted
包括已删除的共享,默认情况下,列表共享不包括已删除的共享
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IncludeSnapshot
包括共享快照,默认情况下,列表共享不包括共享快照。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
共享名称
类型: | String |
别名: | N, ShareName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
输入文件共享资源 ID。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SnapshotTime
Share SnapshotTime
类型: | Nullable<T>[DateTime] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccount
存储帐户对象
类型: | PSStorageAccount |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-StorageAccountName
存储帐户名称。
类型: | String |
别名: | AccountName |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |