I would like to apply the same style of documentation for script examples to my scripts that is frequently demonstrated in the native documentation. As an example, consider the help for the Invoke-Command command.
Get-Help Invoke-Command -Examples
The output of this command contains the following:
Example 3: Run a command in a persistent connection
PS C:\>$s = New-PSSession -ComputerName Server02 -Credential Domain01\User01
PS C:\> Invoke-Command -Session $s -ScriptBlock {Get-Culture}
How do I name my examples so that they appear as above instead of the default -------------------------- EXAMPLE 3 -------------------------- header? The latter is rendered when using a .EXAMPLE directive in the documentation tag.
Furthermore, how can I leverage multi-line examples so that they include the shell path prefix (PS C:\?). I can manually enter this prefix in my documentation to create the effect but I was wondering if there is a different and more compliant method.