I have a Powershell script with rather a big help at the beginning of it to be displayed with the Get-Help command - https://gist.github.com/MarkKharitonov/91698caf8c695902eacde2b6c7825bf1
I have two problems with the way the help is rendered. Specifically with the .EXAMPLE section. Here is an abbreviated version of the help (see the hyperlink for the full version of the script and the help):
<#
.SYNOPSIS
Runs a WinDBG command or a script file.
...
.NOTES
The default is to scan for images using the .imgscan /l. One has to check first with the WinDBG GUI to see if this is necessary, because this is a time consuming operation.
.EXAMPLE
Please, find below a PowerShell session transcript showing the script invoked with the -Command parameter:
PS D:\tmp\cantestr52 - 06-09-2017> cat C:\Users\mkharitonov\runcdb.config.ps1
$Sosex = "E:\Utils\sosex\64\sosex.dll"
$CDB = "e:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe"
$SymbolsCache = "E:\Symbols"
PS D:\tmp\cantestr52 - 06-09-2017> cat .\runcdb.config.ps1
$dump = "d:\tmp\cantestr52 - 06-09-2017\Quartz.Server.DMP"
$ImagePath = "d:\tmp\cantestr52 - 06-09-2017\BJE"
$NoScanForImages = $false
PS D:\tmp\cantestr52 - 06-09-2017> runcdb.ps1 -Command "!dumpheap -mt 00007fff11d90f78 -live"
...
PS D:\tmp\cantestr52 - 06-09-2017>
The script produced two log files:
c:\Users\MKHARI~1\AppData\Local\Temp\!dumpheap_-mt_00007fff11d90f78_-live.log.init
c:\Users\MKHARI~1\AppData\Local\Temp\!dumpheap_-mt_00007fff11d90f78_-live.log
Here is the WinDBG code executed by the script:
| .logopen "c:\Users\MKHARI~1\AppData\Local\Temp\!dumpheap_-mt_00007fff11d90f78_-live.log.init"
| .imgscan /l
| .load E:\Utils\sosex\64\sosex.dll
| !lhi
| .logclose
| .logopen "c:\Users\MKHARI~1\AppData\Local\Temp\!dumpheap_-mt_00007fff11d90f78_-live.log"
| !dumpheap -mt 00007fff11d90f78 -live
| .logclose
| q
#>
Problem 1
Notice that the last lines start with |. This is because of .logopen - PowerShell attempts to treat it as a help section keyword, like .NOTES or .EXAMPLE. Of course, there is no such keyword and so PowerShell just truncates the help output and stops short of showing the last lines. I had to escape the dot somehow, but could not figure out the way.
Problem 2
Notice the C:\PS> in the output. Of course, it is not part of my help.
So, two questions - how to escape the first dot in a help line and what is the source of the C:\PS> in the help output above?

.NOTESentry than a.EXAMPLEentry. The script header is extremely poorly documented, so I doubt you'll find much help on this.>character.logopenis concerned, I do not see your issue, at least on version5.1.15063.502