FatalBulletHit

Console Colors

Oct 23rd, 2019 (edited)
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # https://pastebin.com/mHrpM9DH
  2. # Showcases the available console colors in PowerShell
  3.  
  4. $Host.UI.RawUI.WindowTitle = 'Console Colors'
  5. $Host.UI.RawUI.WindowSize = New-Object System.Management.Automation.Host.Size(22,32)
  6. $Host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size(22,32)
  7.  
  8. 'Black','DarkBlue','DarkGreen','DarkCyan','DarkRed','DarkMagenta','DarkYellow','Gray','DarkGray','Blue','Green','Cyan','Red','Magenta','Yellow','White' | ForEach-Object {
  9.  
  10.     Write-Host -Object ("`n`n {0,-12}" -f $_) -NoNewline
  11.     Write-Host -BackgroundColor $_ -ForegroundColor $_ -Object "        " -NoNewline
  12.  
  13. }
  14.  
  15. Read-Host
Add Comment
Please, Sign In to add comment