使用 Power Platform 連接器的命令
Commands
| Command | Description |
|---|---|
| pac connector create | 在 Dataverse 的連接器資料表中建立新資料列。 |
| pac connector download | 下載連接器的 OpenApiDefinition 和 API 屬性檔案 |
| pac connector init | 初始化連接器的新 API 內容檔案。 |
| pac connector list | 列出在 Dataverse 中註冊的連接器。 |
| pac connector update | 更新 Dataverse 中的連接器實體。 |
pac connector create
在 Dataverse 的連接器資料表中建立新資料列。
範例
下列範例顯示命令的 pac connector create 使用方式。
在目前環境中建立基本連接器
此範例會在目前作用中的驗證設定檔的環境中建立連接器。
pac connector create `
--api-definition-file ./apiDefinition.json `
--api-properties-file ./apiProperties.json
在指定環境中建立基本連接器
此範例會在指定的環境中建立連接器。
pac connector create `
--api-definition-file ./apiDefinition.json `
--api-properties-file ./apiProperties.json
--environment 00000000-0000-0000-0000-000000000000
可選參數 connector create
--api-definition-file
-df
讀取連接器OpenApiDefinition的檔案名稱和路徑。
--api-properties-file
-pf
讀取連接器 API 屬性檔案的檔案名稱和路徑。
--environment
-env
指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。
--icon-file
-if
檔案名稱和路徑 和 圖示 .png 檔案。
--script-file
-sf
指令碼 .csx 檔案的檔名和路徑。
--settings-file
檔案名稱和路徑連接器設定檔案。
--solution-unique-name
-sol
要新增連接器的解決方案的唯一名稱
pac connector download
下載連接器的 OpenApiDefinition 和 API 屬性檔案
範例
下列範例顯示命令的 pac connector download 使用方式。
基本版 connector download
此範例會將指定的連接器下載至目前的目錄。
pac connector download `
--connector-id 00000000-0000-0000-0000-000000000000
Basic connector download 來自指定環境
此範例會將指定的連接器從指定的環境下載到目前的目錄。
pac connector download `
--connector-id 00000000-0000-0000-0000-000000000000 `
--environment 00000000-0000-0000-0000-000000000000
connector download Basic 從指定環境到指定目錄
此範例會將指定的連接器從指定的環境下載到指定的目錄。
pac connector download `
--connector-id 00000000-0000-0000-0000-000000000000 `
--environment 00000000-0000-0000-0000-000000000000 `
--outputDirectory "contoso_Connector"
所需參數 connector download
--connector-id
-id
連接器的ID
附註: 連接器識別碼必須是有效的 Guid。
可選參數 connector download
--environment
-env
指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。
--outputDirectory
-o
輸出目錄
pac connector init
初始化連接器的新 API 內容檔案。
Example
下列範例顯示命令的 pac connector init 使用方式。
連接器初始化,具有輸出目錄和 Microsoft Entra ID OAuth 驗證的連線範本
此範例會初始化目前目錄中的連接器。
pac connector init `
--connection-template "OAuthAAD" `
--generate-script-file `
--generate-settings-file `
--outputDirectory "contoso_Connector"
可選參數 connector init
--connection-template
-ct
產生使用指定範本集的初始「連線參數」。
使用下列其中一個值:
NoAuthBasicAuthApiKeyOAuthGenericOAuthAAD
--generate-script-file
產生初始連接器指令碼檔案
此參數不需要任何值。 這是一個開關。
--generate-settings-file
產生初始連接器設定檔案
此參數不需要任何值。 這是一個開關。
--outputDirectory
-o
輸出目錄
pac connector list
列出在 Dataverse 中註冊的連接器。
範例
下列範例顯示命令的 pac connector list 使用方式。
列出目前環境中的連接器
此範例會列出目前作用中驗證設定檔環境中的所有連接器。
pac connector list
列出指定環境中的連接器
此範例會列出指定環境中的所有連接器。
pac connector list `
--environment 00000000-0000-0000-0000-000000000000
可選參數 connector list
--environment
-env
指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。
--json
將命令的輸出傳回為 JSON 格式的字串。
備註
只會顯示解決方案感知連接器。 當您的連接器不在此命令的回應中時,可能是因為您的連接器無法感知解決方案。
pac connector update
更新 Dataverse 中的連接器實體。
範例
下列範例顯示命令的 pac connector update 使用方式。
目前環境下的基礎connector update
此範例會更新目前作用中驗證設定檔環境中的連接器。
pac connector update `
--api-definition-file ./apiDefinition.json
在指定環境中的基本connector update
此範例會更新指定環境中的連接器。
pac connector update `
--api-definition-file ./apiDefinition.json `
--environment 00000000-0000-0000-0000-000000000000
可選參數 connector update
--api-definition-file
-df
讀取連接器OpenApiDefinition的檔案名稱和路徑。
--api-properties-file
-pf
讀取連接器 API 屬性檔案的檔案名稱和路徑。
--connector-id
-id
連接器的ID
附註: 連接器識別碼必須是有效的 Guid。
--environment
-env
指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。
--icon-file
-if
檔案名稱和路徑 和 圖示 .png 檔案。
--script-file
-sf
指令碼 .csx 檔案的檔名和路徑。
--settings-file
檔案名稱和路徑連接器設定檔案。
--solution-unique-name
-sol
要新增連接器的解決方案的唯一名稱
另請參閱
Microsoft Power Platform CLI 命令群組
Microsoft Power Platform CLI 概觀