Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...