How to run sls invoke --function ... from inside a plugin

Hi everyone!!

I am trying to create an sls plugin (nodejs) that invokes an aws lambda function after sls deploy.
I have tried using this.serverless.pluginManager.spawn(‘invoke’); But it fails with
“This command requires the --function option / -f shortcut. Usage…”
I cannot figure out how to pass the --function option to the spawn method and I also cannot find any
documentation on the pluginManager.spawn method.

Am I going about this the right way or should I be using exec/spawn from child_process?

Thank you