How do I retrieve the available commands from a module?
97,952
Solution 1
Exported commands are not available if the module is not loaded. You need to load the module first and then execute Get-Command:
Import-Module -Name <ModuleName>
Get-Command -Module <ModuleName>
Solution 2
Use the parameter -ListAvailable
Get-Module <moduleName> -ListAvailable | % { $_.ExportedCommands.Values }
"<moduleName>
" is optional. Omit to show all available modules.
Author by
Tom
Updated on March 19, 2020Comments
-
Tom about 4 years
To know which PowerShell modules are available on a machine I use the command
Get-Module -ListAvailable
This returns a list with module-type, -name and the exported commands. But the exported commands are always empty and just displaying
{}
. Why is this not displayed?Do I have to use another parameter or is there another cmdlet or method to retrieve the available commands?