Published: 2019.01.13
Category: PowerShell
Find Module Dependencies
It finds all modules which are dependent on given module.
It looks recursively in the directory to find all psd1 files, next it takes the RequiredModules key and writes it. If the DependencyName parameter is provided. It will write only those modules which require a given dependency to work.
Find-ModuleDependencies without any parameters will go through all directories in the given path and will search for psd1 files, next it will write on the screen value of the RequiredModules key.

If you want to look for a particular dependency just use the parameter DependencyName then it will show just those modules which need provided dependency
Find-ModuleDependencies -Path d:\github -DependencyName ProductivityTools.MasterConfiguration -Verbose

You can also use Like switch parameter if you are not sure how the dependency is named.

When using like switch module automatically adds * to the query.
The below diagram shows on a high level how the module works.
