Syntax highlighting for imported modules

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 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
sapaju
Posts: 4
Joined: Thu Aug 02, 2012 9:09 am

Syntax highlighting for imported modules

Post by sapaju » Thu Aug 02, 2012 9:09 am

Hello,

I'm quite new to PowerShell Studio and did not find a place to import modules into its editor.

I'm using Windows 8 Release Preview and PowerShell Studio 2012 v3.0.7. I have installed RSAT tools, which also gets ActiveDirectory module installed.

In PowerShell console I could write Import-Module ActiveDirectory and it works fine. After that I can use commands from that module like, Get-AdUser, Set-AdUser etc.

When I write Import-Module to PowerShell Studio Editor, the Import-Module gets correct syntax highlight and also PrimalSense works. PrimalSense offers me to import either BitsTransfer or PSDiagnostics but nothing else. I could manually write the ActiveDirectory for the Import-Module, but that does not add AD module to PrimalSense or Syntax highlighting.

Is it somehow possible to add other modules also to PrimalSense and also get syntax highlighting to work on them?

Best regards,
Sami

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Syntax highlighting for imported modules

Post by davidc » Thu Aug 02, 2012 9:21 am

It could be either of the following:1. You have the 32Bit Platform selected and it's a 64Bit only snapin. To change the platform, go to the Ribbon->Home->Platform and select "64 Bit" from the combo box. or 2. You need to refresh PowerShell Studio's cache. To that go to the PowerShell Browser (part of the Object Browser Panel) and click on refresh button. You need to refresh 32 Bit and 64 Bit respectively.David
David
SAPIEN Technologies, Inc.

User avatar
sapaju
Posts: 4
Joined: Thu Aug 02, 2012 9:09 am

Syntax highlighting for imported modules

Post by sapaju » Thu Aug 02, 2012 9:41 am

Thanks for your quick response David.

At the PowerShell console window at the bottom of the Studio window I could import Active Directory module to both consoles, 32bit and 64bit.
I also tested all 4 modes at the Ribbon->Home->Platform, which are 32bit, 32bit Elevated, 64bit and 64bit Elevated. And when I'm on any of those the PowerShell Browser turns to either 64bit or 32bit and I always clicked Refresh button.

After clicking refresh Studio displays on its Output window at the bottom of the Studio window few messages:

>> Building 64 Bit Information...
>> Please allow a few minutes for the caching to complete.
>> Completed 64 Bit Information

And same messages to 32Bit, but of course the bit are changed :)

I also tried to start Studio with "Run as Administrator" option and performed also all the previous steps. But no change.

PowerShell Browser displays only following top level items:
About...
Aliases
Cmdlets
Microsoft.WSMan.Management
BitsTransfer
PSDiagnostics

So it seems to only know about the BitsTransfer and PSDiagnostics modules.

Also by looking inside Cmdlets, there are no ActiveDirectory commands displayed.

BTW. should the PowerShell browser list have more items in it? If I run Get-Module -ListAvailable, I get pretty long list which among others lists also BitsTransfer and PSDiagnostics.



EDIT:
After I installed PowerShell Studio to other machine, which also has windows 8 Release Preview 64bit installed. PowerShell Browser displays only BitsTransfer on that machine. So it even misses the PSDiagnostics.sapaju2012-08-02 16:51:04

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Syntax highlighting for imported modules

Post by davidc » Thu Aug 02, 2012 10:20 am

Nevermind my question. PowerShell Studio doesn't officially support Windows 8 Preview nor PowerShell v3 preview. David
davidc2012-08-02 18:29:26
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Syntax highlighting for imported modules

Post by davidc » Thu Aug 02, 2012 11:30 am



Since Windows 8
preview isn't a release version, we cannot guarantee it will function.David

David
SAPIEN Technologies, Inc.

User avatar
sapaju
Posts: 4
Joined: Thu Aug 02, 2012 9:09 am

Syntax highlighting for imported modules

Post by sapaju » Thu Aug 02, 2012 7:58 pm

Thanks David, for pointing me to right direction. Now I know that the steps to update imported modules to PowerShell Studio are correct.

Today I installed PowerShell Studio to Windows 7 machine and it displays all the same modules like Get-Module -ListAvailable command also lists.

Even the ActiveDirectory module is listed after RSAT installation and refresh of the PowerShell Browser. And to mention, PrimalSense and Syntax highlighting works on those modules too.

So the problem is Windows 8 Release Preview and/or PowerShell 3.0 incompatibility with current version of PowerShell Studio.