共用方式為


Restart-AzContainerGroup

重新啟動容器群組中的所有容器。 如果容器映像有更新,將會下載新的映像。

語法

Restart-AzContainerGroup
       -Name <String>
       -ResourceGroupName <String>
       [-SubscriptionId <String>]
       [-DefaultProfile <PSObject>]
       [-AsJob]
       [-NoWait]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restart-AzContainerGroup
       -InputObject <IContainerInstanceIdentity>
       [-DefaultProfile <PSObject>]
       [-AsJob]
       [-NoWait]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

重新啟動容器群組中的所有容器。 如果容器映像有更新,將會下載新的映像。

範例

範例 1:重新啟動容器群組中的所有容器

Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg

此命令會重新啟動容器群組中的所有容器。

範例 2:透過管線重新啟動容器群組中的所有容器

Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup

此命令會透過管線重新啟動容器群組中的所有容器。

參數

-AsJob

以作業身分執行命令

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

DefaultProfile 參數無法運作。 如果針對不同的訂用帳戶執行 Cmdlet,請使用 SubscriptionId 參數。

類型:PSObject
別名:AzureRMContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

類型:IContainerInstanceIdentity
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Name

容器群組的名稱。

類型:String
別名:ContainerGroupName
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-NoWait

以異步方式執行命令

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-PassThru

當命令成功時傳回 true

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

資源群組的名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-SubscriptionId

可唯一識別Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。

類型:String
Position:Named
預設值:(Get-AzContext).Subscription.Id
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

IContainerInstanceIdentity

輸出

Boolean