Skip to main content
2 of 3
added 25 characters in body

Powershell and batch syntax highlighting is off all around and neither works correctly
(left: StackExchange ; right: Microsoft's VS Code)
Screenshot1

  • It appears batch and Powershell syntax have been linked to each other, which simply doesn't work for either due to the different ways variables and other characters are used between the two:
    • Powershell comments use #, whereas batch uses ::
      Screenshot 2
    • Powershell variables use $, whereas batch uses %<variable>%
      Screenshot3
    • Powershell doesn't support linking commands via &||&&, using ; instead, which batch doesn't support

  • Powershell syntax only syntax highlights if first letter of command or parameter is capitalized, leading to a ridiculous amount of posts not syntax highlighted unless edited, as it doesn't syntax highlight if the entire command/parameter is in all lowercase or all uppercase (latter also affecting batch), which it should since Powershell isn't case aware
    • Powershell and batch syntax highlights don't apply as they should when code fences are used (also an issue with other languages), regardless whether the syntax is specified after the code fence or not - the only way to reliably have it syntax highlighted is to use HTML syntax comment <!-- language-all: lang-powershell --> or lang-bat (wass also an issue with Prettify)
JW0914
  • 258
  • 1
  • 6