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?
Get-Command gets the commands from PowerShell modules and commands that were imported from other sessions. To get only commands that have been imported into the current session, use the ListImported parameter. Without parameters, Get-Command gets all of the cmdlets, functions, and aliases installed on the computer.
List all available modules by executing " module avail " command. The results are a list of module names that can be loaded.
To see all modules installed on the system, use the Get-Module -ListAvailable command.
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>
Use the parameter -ListAvailable
Get-Module <moduleName> -ListAvailable | % { $_.ExportedCommands.Values }
"<moduleName>
" is optional. Omit to show all available modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With