# Script and Module Best Practice question

**URL:** <https://forums.powershell.org/t/script-and-module-best-practice-question/9506>\
**Category:** PowerShell Help\
**Created:** [October 12, 2017, 12:54pm UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506 "2017-10-12T12:54:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 12, 2017, 12:54pm UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/1 "2017-10-12T12:54:13Z")

</div>

I wrote a module with a bunch of functions and I also wrote several tools that use those functions. The tools are also functions. I need to share the module and tools with my team and I want the tools to be easy to access so I added them to the module. That allows a user to type verb-toolname and not have to dot source the script from another location to run the tool. I wanted to get others thoughts on this to see what others do or have done.

---

<div class="post-metadata">

**Author:** ![jmmurrah](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jmmurrah](https://forums.powershell.org/u/jmmurrah)\
**Post date:** [October 12, 2017, 1:32pm UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/2 "2017-10-12T13:32:21Z")

</div>

Yep, that’s the way to do it! Module with all your stuff in it. If you wanted to get really fancy you could look into setting up a private nuget server to host your modules, then you could use stuff like install-module and find-module to download and install the module, rather than dealing with copying your module folder around.

Edit: Also, if you’re not already, now would be a great time to look into putting your module code into some sort of source control system. If you’re in a windows shop maybe check with your devs to see if they use TFS. They can carve you off a team site and set up a GIT repository easily enough.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 12, 2017, 5:38pm UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/3 "2017-10-12T17:38:39Z")

</div>

Thanks, that reassures that my tools can also be in my module.

I created a network module repository and wrote a “setup” script for my team to use to register the repository. I added a script in the module to update modules in the repository once a week. the “setup” script creates a PS profile and adds a line to it to run the update script. So whenever the console runs it will run update-module against all modules that are in the repository.

Source Control is something I really need to get into. I’m not there yet, but its on my moving up list. Platyps is also something I need to work on too.

---

<div class="post-metadata">

**Author:** ![jmmurrah](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jmmurrah](https://forums.powershell.org/u/jmmurrah)\
**Post date:** [October 12, 2017, 9:09pm UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/4 "2017-10-12T21:09:33Z")

</div>

I had a similar process with a network share, trying to keep it all updated. Your solution sounds better than what I had, seems like whatever I tried just resulted in files all over the place and my session would take forever to load. If you’ve done any downloads from the powershell gallery with the powershellget commands it’s pretty clean.

```
Find-Module Platyps | install-module -scope currentuser
```
 might be one to try out. You get hooked on that and it’s hard to go back to a network share.

Oh and on the topic of PlatyPS, it’s pretty awesome. If you already have the comment-based help written for each function, it’s literally two commands to convert everything over.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 13, 2017, 7:26am UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/5 "2017-10-13T07:26:21Z")

</div>

I know the PowerShell Scriting and Toolmaking book covers PlatyPS. I fumbled through using it, but was hoping to find additional documentation about it (tutorials, or guides). Ironically the PlatyPS help documentation seems slim.

---

<div class="post-metadata">

**Author:** ![jmmurrah](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jmmurrah](https://forums.powershell.org/u/jmmurrah)\
**Post date:** [October 13, 2017, 10:09am UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/6 "2017-10-13T10:09:36Z")

</div>

For platyPS check out the powershell unplugged video from ignite. PlatyPS demo starts at around minute 7.

> **[Microsoft Ignite – Join us on October 12-14](https://ignite.microsoft.com/)**
>
> Save the date and explore the latest innovations, learn from product experts and level up your skillset – join us to help shape the future of tech.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:37pm UTC](https://forums.powershell.org/t/script-and-module-best-practice-question/9506/7 "2024-05-16T20:37:23Z")

</div>

Closed on May 16, 2024, 8:37pm UTC


