Massive scripts/functions with folders

I’m looking for some best practice procedure to help me take a PS1 file that contains TONS of functions and convert to individual PS1 files, organized in folders, and be able to execute them without typing in the full path.

So, to break this down a little more I have a lot of functions that I would like to move out of my profile.ps1 file. I copied each function to an individual .ps1 file excluding the function piece so that I can type in C:\Scripts\Script.ps1 -Path C:\Test -Destination C:\Test2 and everything tab completes. The problem is that I want these scripts to be in folder named “Active Directory” or “ConfigMgr” for example and all the Get-ActDirXXXX.ps1 files would be in those folders for organization purposes.

Currently I have about 2 dozen folders containing these scripts. How can I set all 2 dozen folders to be part of my pathing so I don’t have to type in the fully qualified path to execute them?
Should I create a module to contain all this information? Any module how-to’s that you recommend?

Sounds like you may be ready to take a dive into PS modules:

about Modules - PowerShell | Microsoft Learn

Edit: Neemobeer posted right before me sorry about that! That said, their link is probably a bit more helpful for actually writing a module.

in addition to the other link provided these two guy’s and their blogs helped me out a lot when I was starting on module writing:

Appreciate the replies… that was my initial direction but there is a lot involved. I guess once you get it going it gets easier to keep it up to date. Thanks again for the info!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.