I'm new to Visual Studio Code, I'm starting to use it to develop PowerShell scripts.

I see that when I let my cursor on the name of a function I get an overview of the parameters of the function, yet when I do it with my own custom functions, it does not do it.
How do I declare a documentation for my PowerShell functions that can be displayed in the overview by Visual Studio Code ?
I tried to do this :
<#
.Description
Get-Function displays the name and syntax of all functions in the session.
#>
function test([string]$print){}
<# Setup the working directories if they do not exist #>
If(!(Test-Path $WORKING_DIRECTORY)) {test}
But that doesn't seem to work.
Thanks a lot
Adding .PARAMETER to the description worked for me. Also note I believe you have to save and run the script once for it to show.
<#
.Description
Get-Function displays the name and syntax of all functions in the session.
.PARAMETER
#>
function test([string]$print){Write-Host $print}
If(Test-Path $env:userprofile) {test -print "Test123"}

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help?view=powershell-6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With