共用方式為


Remove-AzBastionShareableLink

Bastion Shareable Link 功能可讓使用者使用 Azure Bastion 連線到目標資源(虛擬機或虛擬機擴展集),而不需要存取 Azure 入口網站。

語法

Remove-AzBastionShareableLink
      -ResourceGroupName <String>
      -Name <String>
      -TargetVmId <System.Collections.Generic.List`1[System.String]>
      [-Force]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzBastionShareableLink
      -ResourceId <String>
      -TargetVmId <System.Collections.Generic.List`1[System.String]>
      [-Force]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzBastionShareableLink
      -InputObject <PSBastion>
      -TargetVmId <System.Collections.Generic.List`1[System.String]>
      [-Force]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

刪除要求中指定的所有 VM 的 Bastion 可共享連結。

範例

範例 1

Remove-AzBastionShareableLink -ResourceGroupName $RgName -Name $bastionName -TargetVmId $vm.Id -Force

範例 2

Remove-AzBastionShareableLink -InputObject $bastion -TargetVmId $vm.Id -Force

刪除 Bastion 資源上指定 VM 的可共享連結。。

參數

-AsJob

在背景執行 Cmdlet

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

-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
接受管線輸入:True
接受萬用字元:False

-InputObject

Bastion 物件

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

-Name

Bastion 資源名稱。

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

-PassThru

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

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

-ResourceGroupName

Bastion 資源所在的資源組名

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

-ResourceId

Bastion 資源標識碼

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

-TargetVmId

應刪除 Bastion 可共享連結的 VM 識別碼

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

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

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

輸入

List<T>[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

輸出