With my first C# based Powershell cmdlet I ran into an issue of how to run "existing" cmdlets from within my custom cmdlet. Along the way I found the following:
InvokeCommand.GetCmdlet("Compress-7Zip")
and
InvokeCommand.GetCommand("Compress-7Zip")
- Edit The first returns a CmdletInfo object the second a CommandInfo object
- GetCmdlet has a description "Returns CmdletInfo object that corresponds to the name argument"
- GetCommand has no description, but searching on the web I found the following on Mirosoft's website "Activity to invoke the Microsoft.PowerShell.Core\Get-Command command in a Workflow"
Why do these two methods exist and which do we use for what?