共用方式為


Remove-AzBastion

拿掉防禦資源。

語法

Remove-AzBastion
      -ResourceGroupName <String>
      -Name <String>
      [-PassThru]
      [-Force]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzBastion
      -InputObject <PSBastion>
      [-PassThru]
      [-Force]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzBastion
      -ResourceId <String>
      [-PassThru]
      [-Force]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

拿掉防禦資源。範例 1 會使用其 ResourceGroupName 和 ResourceName 刪除防禦。 範例 2 會使用具有管線的 對象來刪除防禦。 範例 3 會使用其 物件刪除防禦。

範例

範例 1

Remove-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "testBastion2"

範例 2

Get-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "testBastion" | Remove-AzBastion

範例 3

$bastion = Get-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "testBastion"
Remove-AzBastion -InputObject $bastion

參數

-Confirm

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

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

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

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

-Force

請勿要求確認。

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

-InputObject

要刪除的 Bastion 物件。

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

-Name

要刪除的防禦資源名稱。

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

-PassThru

傳回 物件,表示正在執行此作業的專案。

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

-ResourceGroupName

防禦所在的資源組名。

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

-ResourceId

要刪除 Bastion 的 Azure 資源識別碼。

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

-WhatIf

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

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

輸入

PSBastion

String

輸出

Boolean