你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzContainerGroupVolumeObject
为 Volume 创建内存中对象。
语法
New-AzContainerGroupVolumeObject
-Name <String>
[-AzureFileReadOnly]
[-AzureFileShareName <String>]
[-AzureFileStorageAccountKey <SecureString>]
[-AzureFileStorageAccountName <String>]
[-EmptyDir <IVolumeEmptyDir>]
[-GitRepoDirectoryName <String>]
[-GitRepoRepositoryUrl <String>]
[-GitRepoRevision <String>]
[-Secret <ISecretVolume>]
[<CommonParameters>]
说明
为 Volume 创建内存中对象。
示例
示例 1:创建 Azure 文件卷
$pwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey $pwd
Name
----
myvolume
此命令创建 Azure 文件卷。
示例 2:创建空目录卷
New-AzContainerGroupVolumeObject -Name "emptyvolume" -EmptyDir @{} | Format-List
AzureFileReadOnly :
AzureFileShareName :
AzureFileStorageAccountKey :
AzureFileStorageAccountName :
EmptyDir : {
}
GitRepoDirectory :
GitRepoRepository :
GitRepoRevision :
Name : emptyvolume
Secret : {
}
此命令将创建一个空的目录卷。
参数
-AzureFileReadOnly
指示装载为卷的 Azure 文件共享是否为只读的标志。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AzureFileShareName
要装载为卷的 Azure 文件共享的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AzureFileStorageAccountKey
用于访问 Azure 文件共享的存储帐户访问密钥。
类型: | SecureString |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AzureFileStorageAccountName
包含 Azure 文件共享的存储帐户的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EmptyDir
空目录卷。 若要构造,请参阅 EMPTYDIR 属性的 NOTES 部分并创建哈希表。
类型: | IVolumeEmptyDir |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GitRepoDirectoryName
目标目录名称。 不得包含或以“..”开头。 如果提供了“.”,卷目录将是 git 存储库。 否则,如果指定,卷将包含具有给定名称的子目录中的 git 存储库。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GitRepoRepositoryUrl
存储库 URL。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GitRepoRevision
指定修订的提交哈希。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
卷的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Secret
机密卷。 若要构造,请参阅 SECRET 属性的 NOTES 部分并创建哈希表。
类型: | ISecretVolume |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |