你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Remove-WAPackStaticIPAddressPool

删除静态 IP 地址池对象。

注意

本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧 Azure 资源。 创建新的资源时,不建议使用此旧版 PowerShell 模块,因为 ASM 计划停用。 有关详细信息,请参阅 Azure Service Manager 停用

Az PowerShell 模块是推荐的 PowerShell 模块,用于使用 PowerShell 管理 Azure 资源管理器 (ARM) 资源。

语法

Remove-WAPackStaticIPAddressPool
      -StaticIPAddressPool <StaticIPAddressPool>
      [-PassThru]
      [-Force]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

说明

这些主题已弃用,将来将被删除。 本主题介绍 Microsoft Azure PowerShell 模块的 0.8.1 版本中的 cmdlet。 若要了解正在使用的模块版本,请从 Azure PowerShell 控制台键入 (Get-Module -Name Azure).Version

Remove-WAPackStaticIPAddressPool cmdlet 删除静态 IP 地址池对象。

示例

示例 1:删除静态 IP 地址池

PS C:\> $StaticIPAddressPool = Get-WAPackStaticIPAddressPool -Name "ContosoStaticIPAddressPool01"
PS C:\> Remove-WAPackStaticIPAddressPool -StaticIPAddressPool $StaticIPAddressPool

第一个命令使用 Get-WAPackStaticIPAddressPool cmdlet 获取名为 ContosoStaticIPAddressPool01 的静态 IP 地址池,然后将该对象存储在$StaticIPAddressPool变量中。

第二个命令删除存储在$StaticIPAddressPool中的静态 IP 地址池。 该命令会提示你进行确认。

示例 2:在不确认的情况下删除静态 IP 地址池

PS C:\> $StaticIPAddressPool = Get-WAPackStaticIPAddressPool -Name "ContosoStaticIPAddressPool02"
PS C:\> Remove-WAPackStaticIPAddressPool -StaticIPAddressPool $StaticIPAddressPool -Force

第一个命令使用 Get-WAPackStaticIPAddressPool cmdlet 获取名为 ContosoStaticIPAddressPool02 的静态 IP 地址池,然后将该对象存储在 $ StaticIPAddressPool 变量中。

第二个命令删除存储在$StaticIPAddressPool中的静态 IP 地址池。 此命令包括 Force 参数。 该命令不会提示你进行确认。

参数

-Force

强制运行命令而不要求用户确认。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

返回一个代表你所处理的项目的对象。 默认情况下,此 cmdlet 将不产生任何输出。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-Profile

指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。

类型:AzureSMProfile
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-StaticIPAddressPool

指定 StaticIPAddressPool。 若要获取静态 IP 地址池,请使用 Get-WAPackStaticIPAddressPool cmdlet。

类型:StaticIPAddressPool
Position:Named
默认值:None
必需:True
Accept pipeline input:True
Accept wildcard characters:False