external help file | Module Name | online version | schema |
---|---|---|---|
Rnwood.Dataverse.Data.PowerShell.FrameworkSpecific.dll-Help.xml |
Rnwood.Dataverse.Data.PowerShell |
2.0.0 |
Invokes an arbitrary Dataverse request and returns the response.
Invoke-DataverseRequest -Connection <ServiceClient> -Request <OrganizationRequest>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Invoke-DataverseRequest -Connection <ServiceClient> -RequestName <String> [-Parameters <Hashtable>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Invoke-DataverseRequest -Connection <ServiceClient> -Method <HttpMethod> -Path <String> [-Body <PSObject>]
[-CustomHeaders <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
PS C:\> $request = new-object Microsoft.Crm.Sdk.Messages.WhoAmIRequest
PS C:\> $response = Invoke-DataverseRequest -connection $c -request $request
Invokes WhoAmIRequest
using the type from the Dataverse SDK using existing connection $c
and storing the response into a variable.
PS C:\> $request = new-object Microsoft.Xrm.Sdk.OrganizationRequest "myapi_EscalateCase"
PS C:\> $request["Target"] = new-object Microsoft.Xrm.Sdk.EntityReference "incident", "{DC66FE5D-B854-4F9D-BA63-4CEA4257A8E9}"
PS C:\> $request["Priority"] = new-object Microsoft.Xrm.Sdk.OptionSetValue 1
PS C:\> $response = Invoke-DataverseRequest -connection $c -request $request
Invokes myapi_EscalateCase
using without using a request type from the Dataverse SDK using existing connection $c
and storing the response into a variable.
PS C:\> $Target = new-object Microsoft.Xrm.Sdk.EntityReference "incident", "{DC66FE5D-B854-4F9D-BA63-4CEA4257A8E9}"
PS C:\> $Priority = new-object Microsoft.Xrm.Sdk.OptionSetValue 1
PS C:\> $response = Invoke-DataverseRequest -connection $c myapi_EscalateCase @{"Target"=$Target; "Priority=$Priority}
Invokes myapi_EscalateCase
by using just the request name and parameters using existing connection $c
and storing the response into a variable.
PS C:\>invoke-dataverserequest -connection $c -method POST myapi_Example -CustomHeaders @{"foo"="bar"} -Body @{"a"=1; "b"=3}
Invokes the GET
myapi_Example
REST API using custom headers and body
DataverseConnection instance obtained from Get-DataverseConnnection cmdlet
Type: ServiceClient
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Request to execute using the OrganizationRequest
class or subclass from the SDK.
Type: OrganizationRequest
Parameter Sets: Request
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
See standard PS docs.
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Parameters Description }}
Type: Hashtable
Parameter Sets: NameAndInputs
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill RequestName Description }}
Type: String
Parameter Sets: NameAndInputs
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Body Description }}
Type: PSObject
Parameter Sets: REST
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Method Description }}
Type: HttpMethod
Parameter Sets: REST
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Path Description }}
Type: String
Parameter Sets: REST
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill CustomHeaders Description }}
Type: Hashtable
Parameter Sets: REST
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.