0

I have an assembly that contains cmdlets. Can Powershell enumerate the cmdlets available in that assembly, without relying on reflection?

It seems that I should be able to do this with Get-Module, which returns a PSModuleInfo object that has an ExportedCmdlets property, but I can't seem to get results from it with my assembly, though I am able to import the same assembly with Import-Module and then call the cmdlets in it.

1
  • import-module uses reflection internally; no getting away from it. Commented Jun 27, 2010 at 4:12

1 Answer 1

2

Sure, you need to import the binary first:

Import-Module C:\path\to\assemblyName.dll

And then get the cmdlets using the Get-Command cmdlet with the -module parameter:

Get-Command -module assemblyName -type cmdlet
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.