The following documentation for connectors shows that it's possible to call an operation called "ExecuteProcedure". Currently I use it in a flow (power automate), but would like to use it in a powershell script as well.
https://docs.microsoft.com/en-us/connectors/dynamicsax/#execute-action
So far I've created an app in Azure, given all D365 API permissions to it and added it to D365 under system administration. I've successfully been able to get a token and retrieve some data from entities with OData. All I need now is the correct Uri, method, body and whatever to call ExecuteProcedure.
Has anyone done something similar or has any ideas on how I can use this connector?