Importing Relative module does not add commands to intellisense

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
michaelp
Posts: 4
Last visit: Tue May 28, 2019 8:23 pm

Importing Relative module does not add commands to intellisense

Post by michaelp »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.163
OS: Windows Server 2016 Datacenter (64 Bit)
Build: v6.2.9200.0

*** Please add details and screenshots as needed below. ***
Directory Structure:
│ MainScript.ps1

└───Module
│ Module.psd1
│ Module.psm1

├───Private
│ IntFunction.ps1

└───Public
Function1.ps1 - Has function Function1 { param ( [string]$val1 ) write-host $val1 }
Function2.ps1
Function3.ps1

Code:
  1. Import-Module .\Module\Module.psm1
  2.  
  3. Function1 -val1 "Test"
It doesn't look like the module systems will load local modules with just referencing. Is there any way to cache the functions from a module by path?

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 1 time

Re: Importing Relative module does not add commands to intellisense

Post by davidc »

Is this part of a project or individual files? If it is a project you can add the sub-module files (Modules.psd1 and Module.psm1) and set their project properties as follows:

Build = Content
Shared = True

The project will then parse the function declarations from the psm1 file and provide PrimalSense for them.

If they are individual files, then you will have to use the Cache Editor tool to cache the module (Ribbon->Home->Platform->Cache Editor):
Ribbon - Cache Edit.png
Ribbon - Cache Edit.png (36.05 KiB) Viewed 1527 times
Within the Cache Editor tool, press the Import Module... button and select the module you wish to cache:
CacheEdit - Import Module.png
CacheEdit - Import Module.png (52.16 KiB) Viewed 1527 times
You will have to reload the cache within PowerShell Studio (Ribbon->Home->Platform->Reload Cache):
Reload Cache.png
Reload Cache.png (29.63 KiB) Viewed 1527 times
David
SAPIEN Technologies, Inc.