having trouble creating EXAMPLE help text for a fucntion.
here is the function
#.EXAMPLE
# $var = 'Sid'
# Get-Hello $var
#
# This command will return "Hello Sid!"
#
#.EXAMPLE
# Get-Hello
#
# This command will return "Hello World!"
function Get-Hello {
param (
$name = 'World'
)
return "Hello $name!"
}
here is what the first example looks like when i run Get-Help Get-Hello -Examples. note, the second line is not prefixed by ‘PS C:>’ and there are 3 empty lines before the second example
-------------------------- EXAMPLE 1 --------------------------
PS C:\>$var = 'Sid'
Get-Hello $var
This command will return "Hello Sid!"
-------------------------- EXAMPLE 2 --------------------------
desired result is like example 6 of Get-Help Get-ChildItem -Examples. both commands are prefixed by ‘PS C:>’ and there are only two blank lines before the next example
-------------------------- EXAMPLE 6 --------------------------
PS C:\>Import-Module Microsoft.PowerShell.Security
PS C:\>Get-ChildItem -Path Cert:\* -Recurse -CodeSigningCert
This command gets all of the certificates in the Windows PowerShell Cert: drive that have code-signing authority.
The first command imports the Microsoft.PowerShell.Security module into the session. This module includes the
Certificate provider that creates the Cert: drive.
The second command uses the Get-ChildItem cmdlet. The value of the Path parameter is the Cert: drive. The Recurse
parameter requests a recursive search. The CodeSigningCertificate parameter is a dynamic parameter that the
Certificate provider adds to the Get-ChildItem cmdlet. This parameter gets only certificates that have code-signing
authority.
For more information about the Certificate provider and the Cert: drive, go to
http://go.microsoft.com/fwlink/?LinkID=113433 or use the Update-Help cmdlet to download the help files for the
Microsoft.PowerShell.Security module and then type "Get-Help Certificate".
-------------------------- EXAMPLE 7 --------------------------