none
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.

    http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/a5642aaa-0995-4513-bfbd-1e4d62a78ad3

    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.

    http://www.actiprosoftware.com/products/controls/aspnet/codehighlighter


    ¯\_(ツ)_/¯

    Thursday, February 23, 2012 9:07 PM

Answers

All replies