Certain .NET Types are not working with Intellisence

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 7 years and 1 month 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

Certain .NET Types are not working with Intellisence

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:

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

Hello I am using version PowerShell Studio 2017 v5.4.135

when I enter the following, it is not recognized as a type e.g. no intellisense etc..

[System.DirectoryServices.ActiveDirectoryAccessRule]

Therefore I tried the following first

[System.Reflection.Assembly]::LoadWithPartialName('System.DirectoryServices')

This loaded the assembly OK, however [System.DirectoryServices.ActiveDirectoryAccessRule] still does not work e.g. not recognized as not intellisense of methods etc..

I have also tried

Import-Module ActiveDirectory

but again [System.DirectoryServices.ActiveDirectoryAccessRule] not recognized

If I do [System.DirectoryServices.ActiveDirectoryAccessRule] in PowerGUI it is recognized straight away (without loading anything else) it works no problem (intellisense, methods etc.)

Please advise as soon as possible as I will be using the System.DirectoryServices name space more and more often

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

Re: Certain .NET Types are not working with Intellisence

Post by davidc »

If you use the Add-Type cmdlet, PowerShell Studio will automatically load the assembly in the background for PrimalSense purposes:
  1. Add-Type -AssemblyName System.DirectoryServices
Alternatively, if you are working with a psf (GUI) you can set the assembly via Ribbon->Home->Edit->Assemblies.
David
SAPIEN Technologies, Inc.
This topic is 7 years and 1 month 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.