Powershell 7 SDK PSCmdlet - difference between GetCmdlet and GetCommand

Viewed 88

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")  
  1. Edit The first returns a CmdletInfo object the second a CommandInfo object
  2. GetCmdlet has a description "Returns CmdletInfo object that corresponds to the name argument"
  3. 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?

1 Answers
Related