Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Display an ANSI file from PowerShell 5.1 in Windows Terminal

Aug
2,808
144
Code:
function Show-AnsiFile {
    param(
        [Parameter(Mandatory = $true)]
        [string]$Path
    )

    $cp437 = [System.Text.Encoding]::GetEncoding(437)
    $text = [System.IO.File]::ReadAllText((Resolve-Path -LiteralPath $Path), $cp437)
    [System.Console]::Write($text)
}

1789923303067.webp


Ref: Using TYPE to display an .ANS file
Ref: Display an ANSI file on the TCC screen

Joe
 
Back
Top