While I was sifting through old PowerShell code to include in GEM Automation, I found a script I wrote that allows you to find function dependencies in your PowerShell code. This is useful when you want to find things that might get broken by refactoring a certain function or module. It works by looking for modules and scripts in the specified path and then import the modules and their functions and look for those in all the PowerShell code in the specified path.

You can then import the resulting file in Excel for further/easier analysis:

I haven’t tried visualizing the data with NodeXL yet, once I do I will update this post to give you an idea of what that looks like.

You can find the script here:

Get-FunctionUsage.ps1

This will be included in future releases of GEM Automation.

Enjoy!