Powershell - Couleurs
Rédigé par Xpress
Aucun commentaire
Classé dans : Powershell
$host.privatedata.ErrorForegroundColor="Green" $host.privatedata Set-PSReadLineOption -colors @{ Command = "Green"} $profile |format-list * -force Get-PSReadLineOption Set-PSReadLineOption -colors @{ ErrorForegroundColor = "Magenta"} $host.privatedata.ErrorForegroundColor="Green" Set-PSReadlineOption -Tokenkind ErrorForegroundColor -Color Magenta ---------------- lister les couleurs [Enum]::GetValues([System.ConsoleColor]) [Enum]::GetValues([ConsoleColor]) --------------------- Set-PSReadlineOption -TokenKind Operator -ForegroundColor "Magenta" Set-PSReadlineOption -TokenKind Command -ForegroundColor "DarkYellow" Set-PSReadlineOption -TokenKind Parameter -ForegroundColor "Magenta" ------------------- $colors = [enum]::GetValues([System.ConsoleColor]) Foreach ($bgcolor in $colors){ Foreach ($fgcolor in $colors) { Write-Host "$fgcolor|" -ForegroundColor $fgcolor -BackgroundColor $bgcolor -NoNewLine } Write-Host " on $bgcolor"