你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzBatchPool
更新池的属性。
语法
Set-AzBatchPool
[-Pool] <PSCloudPool>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Set-AzBatchPool cmdlet 更新 Azure Batch 服务中池的属性。 使用 Get-AzBatchPool cmdlet 获取 PSCloudPool 对象。 修改该对象的属性,然后使用当前 cmdlet 将更改提交到 Batch 服务。
示例
示例 1:更新池
$Pool = Get-AzBatchPool "ContosoPool" -BatchContext $Context
$StartTask = New-Object Microsoft.Azure.Commands.Batch.Models.PSStartTask
$StartTask.CommandLine = "cmd /c echo example"
$Pool.StartTask = $StartTask
Set-AzBatchPool -Pool $Pool -BatchContext $Context
第一个命令使用 Get-AzBatchPool获取池,然后将其存储在$Pool变量中。 接下来的三个命令修改$Pool对象的启动任务规范。 最后一个命令将更新 Batch 服务以匹配$Pool中的本地对象。
参数
-BatchContext
指定此 cmdlet 用于与 Batch 服务交互的 BatchAccountContext 实例。 如果使用 Get-AzBatchAccount cmdlet 获取 BatchAccountContext,则在与 Batch 服务交互时将使用Microsoft Entra 身份验证。 若要改用共享密钥身份验证,请使用 Get-AzBatchAccountKey cmdlet 获取填充其访问密钥的 BatchAccountContext 对象。 使用共享密钥身份验证时,默认使用主访问密钥。 若要更改要使用的密钥,请设置 BatchAccountContext.KeyInUse 属性。
类型: | BatchAccountContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Pool
指定此 cmdlet 更新 Batch 服务的 PSCloudPool。
类型: | PSCloudPool |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |