Method to find all function references within a script/function

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
adbertram
Posts: 99
Joined: Sun Mar 03, 2013 12:45 pm
Location: Indiana
Contact:

Method to find all function references within a script/function

Post by adbertram » Sun Mar 27, 2016 9:50 am

For large scripts, I sometimes have dozens of custom functions that are called within that script. Each of these functions may then have calls to other custom functions. This makes for potentially large tree of function calls kicked off by the main script. It would be handy for me to have a way to search a script or function and find all function calls within that function. Even better, it would be great to have a way to recursively find all function dependencies that exist for a particular script or function.

Is this possible now?

User avatar
davidc
Posts: 5891
Joined: Thu Aug 18, 2011 4:56 am

Re: Method to find all function references within a script/function

Post by davidc » Mon Mar 28, 2016 9:05 am

Here are a few things you can try:

1. Use the Find All References in the editor's context menu or press [Ctrl + Alt + F]. If the files are all part of a project, it should search them all.

2. The Functions panel lists all the defined functions and reference functions from other files.

3. You can also try using the Find in Files feature [Ctrl + Shift + F].

David
David
SAPIEN Technologies, Inc.