PowerShell – Finding All Modules That Are Part of AzureRM Module

While working on a project tonight that involves Azure PowerShell (more on that in a later blog post) I was curious if I could get a list of all the sub modules inside the AzureRM PowerShell module, which would make it easier to do what I was working on.  The answer is “of course there is!”.  This is how I did it.

The first thing I did was to run the following command to see what all the property values were.  Turns out there is one called Nested Modules.

The next thing that I did was to get all the values inside that property.

Which returned a list of the nested modules, a portion of which looks like this

Just how many nested modules are there?  I’m glad you asked!  There are 55!

Can I get a list of all the Modules by name?

AzureRM.Profile
Azure.Storage
AzureRM.AnalysisServices
Azure.AnalysisServices
AzureRM.ApiManagement
AzureRM.ApplicationInsights
AzureRM.Automation
AzureRM.Backup
AzureRM.Batch
AzureRM.Billing
AzureRM.Cdn
AzureRM.CognitiveServices
AzureRM.Compute
AzureRM.Consumption
AzureRM.ContainerInstance
AzureRM.ContainerRegistry
AzureRM.DataFactories
AzureRM.DataFactoryV2
AzureRM.DataLakeAnalytics
AzureRM.DataLakeStore
AzureRM.DevTestLabs
AzureRM.Dns
AzureRM.EventGrid
AzureRM.EventHub
AzureRM.HDInsight
AzureRM.Insights
AzureRM.IoTHub
AzureRM.KeyVault
AzureRM.LogicApp
AzureRM.MachineLearning
AzureRM.MachineLearningCompute
AzureRM.MarketplaceOrdering
AzureRM.Media
AzureRM.Network
AzureRM.NotificationHubs
AzureRM.OperationalInsights
AzureRM.PowerBIEmbedded
AzureRM.RecoveryServices
AzureRM.RecoveryServices.Backup
AzureRM.RecoveryServices.SiteRecovery
AzureRM.RedisCache
AzureRM.Relay
AzureRM.Resources
AzureRM.Scheduler
AzureRM.ServerManagement
AzureRM.ServiceBus
AzureRM.ServiceFabric
AzureRM.SiteRecovery
AzureRM.Sql
AzureRM.Storage
AzureRM.StreamAnalytics
AzureRM.Tags
AzureRM.TrafficManager
AzureRM.UsageAggregates
AzureRM.Websites

Now, I can do what I was looking to do to begin with, which is to just search for the commands in a specific module.  As an example let’s use the Billing Module.