共用方式為


Get-AzApiManagementProduct

取得清單或特定產品。

語法

Get-AzApiManagementProduct
   -Context <PsApiManagementContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementProduct
   -Context <PsApiManagementContext>
   -ProductId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementProduct
   -Context <PsApiManagementContext>
   [-Title <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementProduct
   -Context <PsApiManagementContext>
   -ApiId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Get-AzApiManagementProduct Cmdlet 會取得清單或特定產品。

範例

範例 1:取得所有產品

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementProduct -Context $apimContext

此命令會取得所有 API 管理產品。

範例 2:依標識符取得產品

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementProduct -Context $apimContext -ProductId "0123456789"

此命令會依標識碼取得 API 管理產品。

範例 2:依標題取得產品

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
$product = Get-AzApiManagementProduct -Context $apimContext -Title 'Starter'
$product | Select-Object -First 1

此命令會依標題選取第一個 API 管理產品。

參數

-ApiId

用來尋找相互關聯產品的 ApiId。 這個參數是選擇性的。

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

-Context

指定 PsApiManagementContext 物件的實例。

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

-DefaultProfile

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

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

-ProductId

指定要搜尋的產品標識碼。

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

-Title

指定要尋找的產品標題。 如果指定,Cmdlet 會嘗試依標題取得產品。

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

輸入

PsApiManagementContext

String

輸出

PsApiManagementProduct