I am writing a Powershell cmdlet in C# by inheriting from PSCmdlet. This is part of a powershell module which contains both binary and script components.
I want to be able to invoke a script module cmdlet from within my binary cmdlet.
I've worked out that inheriting from PSCmdlet gives me access to a lot more of Powershell's guts, and I have looked specifically at InvokeCommand.GetCmdlet() and InvokeCommand.GetCommand() but these both seem to return CommandInfo objects which don't appear to have a method to invoke them.
Am I supposed to call InvokeCommand.InvokeScript() to call my cmdlets? If so how/are CommandInfo objects supposed to be used to help?