Remove-AzApiManagementPolicy
從指定的範圍中移除 API 管理 原則。
Syntax
Remove-AzApiManagementPolicy
-Context <PsApiManagementContext>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzApiManagementPolicy
-Context <PsApiManagementContext>
-ProductId <String>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzApiManagementPolicy
-Context <PsApiManagementContext>
-ApiId <String>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzApiManagementPolicy
-Context <PsApiManagementContext>
-ApiId <String>
-OperationId <String>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Remove-AzApiManagementPolicy Cmdlet 會從指定的範圍中移除 API 管理 原則。
範例
範例 1:移除租用戶層級原則
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Remove-AzApiManagementPolicy -Context $apimContext
此命令會從 API 管理 移除租用戶層級原則。
範例 2:移除產品範圍原則
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Remove-AzApiManagementPolicy -Context $apimContext -ProductId "0123456789"
此命令會從 API 管理 移除產品範圍原則。
範例 3:移除 API 範圍原則
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Remove-AzApiManagementPolicy -Context $apimContext -ApiId "9876543210"
此命令會從 API 管理 移除 API 範圍原則。
範例 4:移除作業範圍原則
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Remove-AzApiManagementPolicy -Context $apimContext -ApiId "9876543210" -OperationId "777"
此命令會從 API 管理 移除作業範圍原則。
參數
-ApiId
指定現有 API 的識別碼。 如果您指定此參數,Cmdlet 會移除 API 範圍原則。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
執行 Cmdlet 之前先提示您確認。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Context
指定 PsApiManagementContext 對象的實例。
Type: | PsApiManagementContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OperationId
指定現有作業的識別碼。 如果您使用 ApiId 參數指定此參數,此 Cmdlet 會移除作業範圍原則。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
表示這個 Cmdlet 會傳回 $True 的值,如果成功,則傳回 $False 的值,否則傳回 。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProductId
指定現有產品的識別碼。 如果您指定此參數,Cmdlet 會移除產品範圍原則。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |