# Function or Module, how to

**URL:** <https://forums.powershell.org/t/function-or-module-how-to/12826>\
**Category:** PowerShell Help\
**Created:** [July 6, 2019, 8:49am UTC](https://forums.powershell.org/t/function-or-module-how-to/12826 "2019-07-06T08:49:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lake](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@lake](https://forums.powershell.org/u/lake)\
**Post date:** [July 6, 2019, 8:49am UTC](https://forums.powershell.org/t/function-or-module-how-to/12826/1 "2019-07-06T08:49:03Z")

</div>

Hello,

I have done some powershell scripts to the server.

I would like make scripts to functions or modules so

Everyone who has access to the server, so they can call them

From powershell command line without going to scripts location or import anything.

&nbsp;

Should I save them then %windir%\system32\WindowsPowerShell\v1.0\profile.ps1

Or somehow to save to them as some modules.

I think module is easy handle, so I can group Functions.

How I can make module automatically activated so it doesn’t

Need to be loaded?

Or how I should be doing this?

---

<div class="post-metadata">

**Author:** ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)\
**Post date:** [July 6, 2019, 8:52am UTC](https://forums.powershell.org/t/function-or-module-how-to/12826/2 "2019-07-06T08:52:40Z")

</div>

From PowerShell version 3.0 on wards, any modules under the $env:PSModulePath locations will be auto loaded. You can place the module under any folder which is specified in that environment variable. Modules folder under $env:HomePath\Documents\Windows\PowerShell is the one which is recommended.

The module auto load is handled using $PSModuleAutoLoadingPreference automatic variable, setting this to $false will disable auto loading feature.

---

<div class="post-metadata">

**Author:** ![lake](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@lake](https://forums.powershell.org/u/lake)\
**Post date:** [July 6, 2019, 9:10am UTC](https://forums.powershell.org/t/function-or-module-how-to/12826/3 "2019-07-06T09:10:51Z")

</div>

Hello,

Big thanks your advice!

---

<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:32pm UTC](https://forums.powershell.org/t/function-or-module-how-to/12826/4 "2024-05-16T20:32:03Z")

</div>

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


