Intellisense not working

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.
This topic is 6 years and 8 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
ErnieB
Posts: 56
Last visit: Mon Dec 19, 2022 2:09 am

Intellisense not working

Post by ErnieB »

Product, version and build:
(*** Please do not write "latest" as a version, specify a version number ***)
32 or 64 bit version of product:
Operating system:
32 or 64 bit OS:
PowerShell Version:

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

Hello, I have a lot of issues with Intellisense here is another example

[System.Reflection.Assembly]::LoadWithPartialName('system.DirectoryServices.DirectorySearcher')
$S = new-object system.DirectoryServices.DirectorySearcher
$S.Filter = "sAMAccountName=Ernest.Brant"
$S.PropertiesToLoad.AddRange(('Department','EmployeeID'))

[pscustomobject]$X = $S.FindOne().Properties.GetEnumerator() | % { $HT = @{ } } { $HT.Add($_.Key, $_.Value) } { [pscustomobject]$HT }

$Y = [pscustomobject]@{ 'name' = 'Ernie'; 'town' = 'Poole'}

The above creates two variables $X and $Y both of which are of type System.Management.Automation.PSCustomObject

However when you run the script and them try to use intellisense e.g. $X. or $Y. you do not get back any of the properties that you set (in the case of $Y you get back nothing at all)

This is very frustrating as other IDEs like PowerShell ISE and PowerShell Studio both deal with the Intellisense correctly, therefore I keep switching back to these other editors which I should not have to do for a commercial product.
Please resolves

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

Re: Intellisense not working

Post by davidc »

PowerShell Studio gathers PrimalSense without running PowerShell scripts. At this time, the runspace PowerShell Studio uses is external and reset on each run.

On our wish list is to persist the runspace to provide PrimalSense, but in the meantime, I recommend using the script in the console to verify the properties. I know this isn't ideal, but this is something we plan to address.
David
SAPIEN Technologies, Inc.
User avatar
ErnieB
Posts: 56
Last visit: Mon Dec 19, 2022 2:09 am

Re: Intellisense not working

Post by ErnieB »

Hello David

Thank you for the reply, I am not sure I full understand your answer.

You said "PowerShell Studio gathers PrimalSense without running PowerShell scripts"

therefore if I type the code

$Y = [pscustomobject]@{ 'name' = 'Ernie'; 'town' = 'Poole' }

If PrimalSense gathers information 'without' running the script why does it not give intellisense when I type $Y. (e.g. come up with the properties name & town) ?

You also said "I recommend using the script in the console to verify the properties"

Therefore I selected the above code, right clicked it and selectioned "Run Selection In Console" the code executed, which I know because if I type $Y then press enter it returns the contents of the hash table

However I still have no intellisense because (staying in the console) if I type $Y. again I get no properties of this object (name & town do not show up again)

One of the 'main' reasons for using an IDE is intellisense, this is a really big deal when wrtting scripts. Today I have downloaded your very latest updates but still not intellisense in the areas discussed when this intellisense is already present in serveral other IDEs like PowerShell ISE and PowerGUI (and probably several others).

When do Sapien plan to fix this rather major drawback please

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

Re: Intellisense not working

Post by davidc »

The embedded console is a separate process and is not linked to the editor. I only suggest it for discovering properties.

And yes, we plan to tackle this issue so that it will provide the PrimalSense for the last state of the object.
David
SAPIEN Technologies, Inc.
User avatar
ErnieB
Posts: 56
Last visit: Mon Dec 19, 2022 2:09 am

Re: Intellisense not working

Post by ErnieB »

Thank you David

I like PowerShell Studio very much, and look forward to this functionality when released.

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

Re: Intellisense not working

Post by davidc »

Please try the latest service release (v5.4.142). We added a mechanism to provide PrimalSense for custom objects:

https://www.sapien.com/blog/2017/07/20/ ... -v5-4-142/
David
SAPIEN Technologies, Inc.
This topic is 6 years and 8 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.