The Get-PowerPlatformConnection PowerShell cmdlet is used to establish a connection to Dataverse (CRM). It supports two distinct parameter sets for authentication: using a connection string or using Federated Identity Credentials (FIC) parameters.
Parameter Sets
1. ConnectionStringOnly
Use this set if you have a complete connection string. When this parameter is provided, all other connection elements are ignored.
ConnectionString (Mandatory, Position 1)
2. FIC (Federated Identity Credentials)
Use this set to provide individual identity components. All parameters in this set are mandatory.
TenantId (Mandatory, Position 1): The Tenant Id of the FIC.ClientId (Mandatory, Position 2): The Client Id of the FIC.ServiceConnectionId (Mandatory, Position 3): The Service Connection Id of the FIC.OrganizationUrl (Mandatory, Position 4): The URL of the Dataverse organization.AccessTokenEnvKeyName (Optional, Position 4): The name of the environment variable containing the Access Token.
# Example using a Connection String
Get-PowerPlatformConnection -ConnectionString "Auth=OAuth;Url=https://org.crm.dynamics.com;Token=..."
# Example using FIC parameters
Get-PowerPlatformConnection \
-TenantId "00000000-0000-0000-0000-000000000000" \
-ClientId "11111111-1111-1111-1111-111111111111" \
-ServiceConnectionId "22222222-2222-2222-2222-222222222222" \
-OrganizationUrl "https://org.crm.dynamics.com"