Hello,
In a script, can we trigger a custom command?
Yes, it is possible to execute custom commands using scripts. For examples, see https://adaxes.com/sdk/SampleScripts.ExecutingCustomCommands.
Then I could put the approval on the custom command.
Unfortunately, this will not work. If you execute a custom command in a script and use the $Context.SubmitForApproval method in the same script, it will not send the custom command execution for approval. Instead, the operation that triggered execution of the script will be submitted for approval. You need to use the approach from the reply to the initial Q&A post - enabling the Get approval for this action option in the configuration of the Run a program or PowerShell script action.