How do I retrieve the available commands from a module? How do I retrieve the available commands from a module? powershell powershell

How do I retrieve the available commands from a module?


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.


This will List all the commands under a module and search through them:

Get-Command -Module dbatools| ?{$_.name -match 'service'}