Created
April 10, 2024 22:20
-
-
Save JeffMill/d7d97a26710c3d6d873d2a4cf4fe607e to your computer and use it in GitHub Desktop.
PowerShell ansi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 | |
function Write-Bold() { | |
param([Parameter(Mandatory)][string]$Message) | |
$ESC = [char]27 | |
"$ESC[1m$Message$ESC[0m" | |
} | |
function Write-Italic() { | |
param([Parameter(Mandatory)][string]$Message) | |
$ESC = [char]27 | |
"$ESC[3m$Message$ESC[0m" | |
} | |
function Write-Underlined() { | |
param([Parameter(Mandatory)][string]$Message) | |
$ESC = [char]27 | |
"$ESC[4m$Message$ESC[0m" | |
} | |
function Write-Inverse() { | |
param([Parameter(Mandatory)][string]$Message) | |
$ESC = [char]27 | |
"$ESC[7m$Message$ESC[0m" | |
} | |
Write-Bold -Message 'this is bold.' | |
'' | |
Write-Italic -Message 'this is italic.' | |
'' | |
Write-Underlined -Message 'this is underlined.' | |
'' | |
Write-Inverse -Message 'this is inverse.' | |
'' | |
'Normal.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment