你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Update-AzureRmContainerService
汇报容器服务的状态。
警告
截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。
尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源。
语法
Update-AzureRmContainerService
[-ResourceGroupName] <String>
[-Name] <String>
[-ContainerService] <PSContainerService>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Update-AzureRmContainerService cmdlet 更新容器服务的状态以匹配服务的本地实例。
示例
示例 1:更新容器服务
PS C:\> Get-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" | Remove-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" | Add-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17" -Count 2 | Update-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17"
此命令使用 Get-AzureRmContainerService cmdlet 获取名为 CSResourceGroup17 的容器服务。 该命令使用管道运算符将该对象传递给 Remove-AzureRmContainerServiceAgentPoolProfile cmdlet。 Remove-AzureRmContainerServiceAgentPoolProfile 删除名为 AgentPool01 的配置文件。 该命令将结果传递给 Add-AzureRmContainerServiceAgentPoolProfile cmdlet。 Add-AzureRmContainerServiceAgentPoolProfile 添加一个配置文件,该配置文件的名称为 AgentPool01,并且具有指定的属性。 该命令将结果传递给当前 cmdlet。 当前 cmdlet 更新容器服务,以反映此命令中所做的更改。
参数
-AsJob
在后台运行 cmdlet
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ContainerService
指定包含更改的本地 ContainerService 对象。
类型: | PSContainerService |
Position: | 3 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
指定此 cmdlet 更新的容器服务的名称。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
指定此 cmdlet 更新的容器服务的资源组。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
参数:ContainerService (ByValue)