2017-07-07 23 views
2

我想更改Powershell中參數-a, --All的顏色。我改變了我在Powershell中的字符串和命令顏色。Powershell連字符參數顏色

Set-PSReadlineOption -TokenKind String -ForegroundColor Cyan 
Set-PSReadlineOption -TokenKind Command -ForegroundColor Magenta 

我無法找到如何更改連字符參數顏色。

它是否在Set-PSReadlineOption或其他地方?

回答

4

您正在尋找的Parameter令牌類型:

Set-PSReadlineOption -TokenKind Parameter -ForegroundColor Red 

將上面的顏色參數標記(如-a)紅色,但不裸字符串前綴令牌--(如--All),因爲他們是技術上不被解析器視爲參數標記。