How to make PowerShell Studio import custom modules?

Use this forum to ask questions before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
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.
User avatar
amloessb
Posts: 10
Joined: Fri Jun 09, 2017 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by amloessb » Wed Jun 14, 2017 10:16 am

No, there's no manifest. I haven't needed the features that using a manifest provides, and not using one has never caused any issues.

Microsoft's own documentation states that, "for simple modules that contain only a single .psm1 or binary assembly, a module manifest is optional."
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

User avatar
Alexander Riedel
Posts: 6188
Joined: Tue May 29, 2007 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by Alexander Riedel » Wed Jun 14, 2017 11:07 am

My apologies, I wasn't trying to say there should be one. I was just making sure I have everything. It could have been you only sent the .psm1, so I wanted to make sure.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
amloessb
Posts: 10
Joined: Fri Jun 09, 2017 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by amloessb » Wed Jun 14, 2017 12:45 pm

No worries. Thanks for clearing that up.

User avatar
Alexander Riedel
Posts: 6188
Joined: Tue May 29, 2007 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by Alexander Riedel » Wed Jun 14, 2017 3:16 pm

Replace the attached file in your installation, fire up the cacheeditor and re-import your module.
Please let me know if that helps.
Attachments
ImportModule.zip
(6.97 KiB) Downloaded 6 times
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
amloessb
Posts: 10
Joined: Fri Jun 09, 2017 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by amloessb » Wed Jun 14, 2017 4:08 pm

That works, thanks!
https://i.imgur.com/vYadjR3.png
Also, I just want to confirm my understanding based on what you said earlier: If I modify a module without bumping its version number (which I guess is what would happen if I don't have a manifest), PowerShell Studio won't see the changes (new functions, etc.) unless I remove and re-add it through the cache editor?

User avatar
Alexander Riedel
Posts: 6188
Joined: Tue May 29, 2007 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by Alexander Riedel » Thu Jun 15, 2017 10:05 am

Well, the versioning exists for that reason. If you modify the version as you update a module, you just need to rebuild the cache. It should pick it up automatically.
If it sees V0.0 and it already has that, it won't update it. So yes, you need to specifically import it again.
It is not really required to have a manifest for a module, but my personal opinion is that it should be :D
Having a valid version resource is a best practice for all types of modules across all types of programming languages.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
amloessb
Posts: 10
Joined: Fri Jun 09, 2017 4:43 pm

Re: How to make PowerShell Studio import custom modules?

Post by amloessb » Thu Jun 15, 2017 12:45 pm

I understand, I just wanted to confirm the application's behavior. Thanks very much for your help.