import module into IDE

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 10 years and 7 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
island_guy
Posts: 14
Last visit: Thu Feb 02, 2017 6:12 am

import module into IDE

Post by island_guy »

I currently connect to our service by:

$cred = Get-Credential
$session = New-PSSession -Authentication basic -Credential $cred -ConnectionUri https://email.loc.org/PowerShell/ -ConfigurationName Microsoft.Exchange -AllowRedirection -SessionOption (New-PSSessionOption -SkipRevocationCheck)
Import-PSSession $session

At this point it imports the module library for my power shell session. And I complete the task..

I would like to use Power Shell Studio to create some simple forms but it does not recognize the cmdlet -GetCSAMailbox mailbox-name@loc.org or others in the library it imports, when I connect.

I assume, I have to import that module into Power Shell Studio in order to have access to these cmdlets. How do I do this?

Please redirect if I am in the wrong place. I like the product and would like to make it my IDE for powershell applications (GUI).

Thank you.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: import module into IDE

Post by davidc »

FYI, I moved the post to the Trail Software Questions forum. If you are a licensed user, you can post in the PowerShell Studio Forum.


As for module coloring please refer to the following blog posts:

http://www.sapien.com/blog/2012/10/15/d ... es-part-1/

http://www.sapien.com/blog/2012/10/16/d ... es-part-2/

These articles cover how to get syntax coloring for modules that are not installed locally.

David
David
SAPIEN Technologies, Inc.
User avatar
island_guy
Posts: 14
Last visit: Thu Feb 02, 2017 6:12 am

Re: import module into IDE

Post by island_guy »

David, I followed the two pages and I don't think I explained my situation maybe.

I do not see the cmdlets in PS Studio, even though it seems like a success. I want to make sure you understand my situation. When I connect to our cloud MSOLS as I posted previously, it loads a module of cmdlets. I do not have physical or remote access to any system. So I ran the cacheexport.exe on my local workstation where, I connect and perform my work.

Am I doing something wrong?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: import module into IDE

Post by davidc »

What PowerShell version and OS are you using?

Note: If the modules are on a remote system, the local instance of the IDE will not know what to color.

If you have these modules locally, check the PowerShell Panel and it should list all the modules that are automatically found by PowerShell. If the module is not in a discoverable location it may not be cached.

David
David
SAPIEN Technologies, Inc.
User avatar
island_guy
Posts: 14
Last visit: Thu Feb 02, 2017 6:12 am

Re: import module into IDE

Post by island_guy »

Hi David,

I am running PS v3. OS Win7 Maybe, I am asking the wrong question. I am interested in coloring in the IDE but more interested in just working in the active session (form) How do I import or connect via the active FORM? I see that it imports -Module ISE and MSOnlineExtended, how do I import my session when I connect. I currently connect like so:

$cred = Get-Credential
$session = New-PSSession -Authentication basic -Credential $cred -ConnectionUri https://email.loc.org/PowerShell/ -ConfigurationName Microsoft.Exchange -AllowRedirection -SessionOption (New-PSSessionOption -SkipRevocationCheck)
Import-PSSession $session

Thank you.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: import module into IDE

Post by davidc »

I see, you were really asking two questions here. The experts in the PowerShell forums are better suited to answer question about sessions and implicit remoting. Just make sure the GUI script is run locally and not remotely otherwise you will not see the GUI. You can consider using Invoke-Command instead as well.

As for the coloring, again the IDE has no way of knowing what modules are on the remote machine, so it is unable to give you color feedback in this instance.

David
David
SAPIEN Technologies, Inc.
This topic is 10 years and 7 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.