LoginSignup
5
4

More than 5 years have passed since last update.

PowerShellのカラーテストスクリプト

Posted at

16色ですが。
color.ps1とかで保存して、実行。他にいい書き方はないものかな。

@(
    "black"
    "darkblue"
    "darkgreen"
    "darkcyan"
    "darkred"
    "darkmagenta"
    "darkyellow"
    "gray"
    "darkgray"
    "blue"
    "green"
    "cyan"
    "red"
    "magenta"
    "yellow"
    "white"
) | % {
    Write-Host $_ -ForegroundColor $_ -NoNewline
    Write-Host "`t`t" -NoNewline
    Write-Host $_ -ForegroundColor $_ -BackGroundColor white
}

powershell_color.png

普通のコマンドプロンプトでANSIエスケープシーケンスによる色を有効にしたい場合はANSICONを併用するといい感じになります。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4