New 'Insert Code' editor exhibits more failure modes. RRS feed

  • Question

  • Her eis an example of syntax highlighting gone complete awry because of line extension cahracters in PowerShell.

    First reply to original post code.

    Her eis a copy of treh code block

    This waits on a keystroke.

    $evt=Register-ObjectEvent `
          -InputObject $timer '
          -EventName elapsed '
          -SourceIdentifier theTimer '
          -Action {Write-Host 'Restarting Computer'}
    Write-Host 'Your Machine Will Reboot At:$rebootTime'
    Write-Host 'Press any key to cancel reboot...'
    while(-not $host.UI.RawUI.KeyAvailable){}
    Unregister-Event $evt

    Note that the colorization assumes a string after the first line extender.

    I have used many syntax highlighters fro PowerSnell and never have seen one that works so poorly.

    The following highlighter works extremely well and produces very clean HTML.


    Thursday, February 23, 2012 9:07 PM


All replies