# Creating Script Modules

**URL:** <https://forums.powershell.org/t/creating-script-modules/1986>\
**Category:** PowerShell Help\
**Created:** [October 20, 2013, 10:43pm UTC](https://forums.powershell.org/t/creating-script-modules/1986 "2013-10-20T22:43:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amandeep-bhatia](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@amandeep-bhatia](https://forums.powershell.org/u/amandeep-bhatia)\
**Post date:** [October 20, 2013, 10:43pm UTC](https://forums.powershell.org/t/creating-script-modules/1986/1 "2013-10-20T22:43:22Z")

</div>

I have 3 powershell scripts that I created. Now, I want to deploy them to a common server to which various users will have access(using powershell web access) and they can issue cmdlets that I created.

Initially I thought, it would be a pretty simple process. But may be I was wrong or may be I am missing something.

To create a Script module, I copied all my scripts into a single psm1 file.  
Next step was how to make sure this is registered. I followed below post to register the module file.  
[http://msdn.microsoft.com/en-us/library/windows/desktop/dd878350(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/windows/desktop/dd878350(v=vs.85).aspx)

But for some reason I am still not able to see my cmdlets in new session. Are there any clear steps i can follow or what is it i am not doing correctly.

Again, i was not able to edit the PSModulePath using the script in above link so i edited the env variable manually and added my module path. Still i dont see my cmdlets. Please help!

Thanks for the anticipation in advance.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [October 21, 2013, 12:32am UTC](https://forums.powershell.org/t/creating-script-modules/1986/2 "2013-10-21T00:32:33Z")

</div>

What matters is WHERE and HOW you edited your PSModulePath environment variable. You can’t do it from within PowerShell - that won’t change anything more than the current session. You need to persistently change PSModulePath by changing it from the Windows Control Panel or via GPO.

And you’re technically not “registering” the module. It simply needs to live in a place where PowerShell knows to look for it, if you want module auto-loading and auto-discovery to work.

You should be able to open a new shell session, run “$env:psmodulepath”, and see your revised PSModulePath. If you don’t, then you need to solve that.

---

<div class="post-metadata">

**Author:** ![amandeep-bhatia](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@amandeep-bhatia](https://forums.powershell.org/u/amandeep-bhatia)\
**Post date:** [October 21, 2013, 2:25pm UTC](https://forums.powershell.org/t/creating-script-modules/1986/3 "2013-10-21T14:25:37Z")

</div>

Hello,

Thanks for the reply. May be i was not explicit in my last line of previous post for setting environment variable. I have set the environment variable manually from control panel.  
Now, When i run $env:PSModulePath in a new session of powershell I could see my path there.

But not sure if that path is getting scanned or not, i dont see my modules being registered.  
I also tried adding export-modulemember -function \<functionname\>

Not sure what else i am missing.

---

<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:56pm UTC](https://forums.powershell.org/t/creating-script-modules/1986/4 "2024-05-16T20:56:57Z")

</div>

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


