What is @msftrncs working on?
-
Statement based syntax highlighting for PowerShell in VS Code and other editors.
-
Alter PowerShell such that PSReadLine can highlight the
default
keyword of theswitch
default condition.
using namespace System.Management.Automation.Language | |
function CmdRequiresQuote ([string]$in) { | |
[QuoteCheck]::CmdRequiresQuote($in, $false) | |
} | |
function CmdRequiresQuote ([string]$in, [bool]$IsExpandable = $false) { | |
[Token[]]$_tokens = $null | |
(_CommonRequiresQuote $in $IsExpandable ([ref]$_tokens)) -or | |
-not $IsExpandable -and ($_tokens[0].Kind -in ( |
Set-PSReadLineOption -Colors @{ | |
Command = 'DarkYellow' | |
Comment = 'DarkGray' | |
Keyword = 'Magenta' | |
Member = 'White' | |
Number = 'Cyan' | |
Operator = 'Blue' | |
Parameter = 'Yellow' | |
String = 'Green' | |
Type = 'Red' |
Statement based syntax highlighting for PowerShell in VS Code and other editors.
Alter PowerShell such that PSReadLine can highlight the default
keyword of the switch
default condition.
filter Format-Bytes { | |
if ($_ -is [ValueType]) { | |
$x = if (0 -ne $_) { | |
[Math]::Min([int][Math]::Truncate([Math]::Log([Math]::Abs($_), 1kb)), 8) | |
} else { | |
0 | |
} | |
if ($x -eq 0) { | |
"$_ B" | |
} else { |
function Find-GitDirectory { | |
param ( | |
[string[]] $Path = '.', | |
[switch] $Recurse | |
) | |
$gciParams = @{ | |
Recurse = $Recurse | |
Force = $true |