Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 180

PowerShell Syntax Highlighting

$
0
0

I mainly answer PHP questions where syntax highlighting has always worked for me with just indentation. I've just started using PowerShell and have asked a couple of questions and syntax highlighting seems to be wonky:

. "$PSScriptRoot\third.ps1"#get $Current  = second.ps1#get $Caller   = first.ps1 #get $Original = first.ps1$wc = new-object System.Net.WebClient$wc.Headers.Add("user-agent", "PowerShell Script")$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials$action = [System.IO.Path]::GetFileNameWithoutExtension($myInvocation.MyCommand.Name)

Wouldn't even some default syntax highlighting get one of the most common comment # styles right?

mklement0 states in Get original script name included script name and possibly others that using ```sh is a hack to get it to work:

    . "$PSScriptRoot\third.ps1"    #get $Current  = second.ps1    #get $Caller   = first.ps1     #get $Original = first.ps1    $wc = new-object System.Net.WebClient    $wc.Headers.Add("user-agent", "PowerShell Script")    $wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials    $action = [System.IO.Path]::GetFileNameWithoutExtension($myInvocation.MyCommand.Name)

Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>