Method / Class Comments with Intellisense

I have written a PowerShell Class with static methods. It works quite swiftly and efficiently.

I would like the ability to add comments to the Class and the Methods which will appear in an IDE (e.g. VScode) while writing Advanced Functions that use the Class. In Python one can surround the comments with three single quotes (‘’‘comment’‘’) as shown below. Those comments appear in VScode when writing against the class/function.

Is there a Methodology (wink) for this in PowerShell? If so, what is it? I’ve tried /// and # and ‘’’ to no avail.


class MyClass():

‘’‘My Comments Here’‘’

def my_function:

‘’‘More comments here’‘’

Class myClass
# Comments here that are used by Intellisense?
static [hashtable] myMethod ([string] $myVar)
# Comments here that are used by Intellisense

@Joe Acosta
Below Article might help you

Nitesh Bhat

The link does not mention classes, methods, or how to make comments for them that appear in intellisense. So no, not at all helpful. Thanks tho.

Why not just look at the PowerShell classes MS provides that are already on your system as the examples to follow for your use case, or jump out to the PowerShell Core OSS repo and look at the source code for all the cmdlet for examples?

This ’ /// ’ of course is not how you do comments in PowerShell proper. There is on ‘#’ or ‘<##>’ , though the .Net stuff (C#, etc.) does use that, thus, well, you know.

See also:

Comment-based Help for classes

How To Document Your PowerShell Library


You’re looking for the Insert XML Comments functionality to give you in-line IntelliSense descriptions. JavaScript has a similar feature called JSDoc. Unfortunately, this is a language-specific feature and even though PowerShell borrows some syntax from C# it does not include this feature.

@grokkit - thanks for the response. I came to the same conclusion, but thought I would ask just in case I missed something simple. Fortunately its not a major item. Thanks again!