How to make PowerShell Studio import custom modules?

Use this forum to ask questions after your subscription maintenance expires or 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.
This topic is 6 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
amloessb
Posts: 10
Last visit: Wed Nov 18, 2020 11:45 am

Re: How to make PowerShell Studio import custom modules?

Post by amloessb »

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: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

Re: How to make PowerShell Studio import custom modules?

Post by Alexander Riedel »

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
Last visit: Wed Nov 18, 2020 11:45 am

Re: How to make PowerShell Studio import custom modules?

Post by amloessb »

No worries. Thanks for clearing that up.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

Re: How to make PowerShell Studio import custom modules?

Post by Alexander Riedel »

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 215 times
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
amloessb
Posts: 10
Last visit: Wed Nov 18, 2020 11:45 am

Re: How to make PowerShell Studio import custom modules?

Post by amloessb »

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: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

Re: How to make PowerShell Studio import custom modules?

Post by Alexander Riedel »

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
Last visit: Wed Nov 18, 2020 11:45 am

Re: How to make PowerShell Studio import custom modules?

Post by amloessb »

I understand, I just wanted to confirm the application's behavior. Thanks very much for your help.
This topic is 6 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.