8000 Add function to preview theme · Issue #107 · jasonmarcher/PowerTab · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add function to preview theme #107
Open
@jasonmarcher

Description

@jasonmarcher

Convert this code into a usable function:

function Show-ConsoleListPreview {
    $Colors = $PowerTabConfig.ConsoleList.Colors
    Write-Host " " -NoNewLine
    Write-Host "┌─"           -ForegroundColor $Colors.BorderColor     -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host " I"           -ForegroundColor $Colors.BorderTextColor -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "tem "         -ForegroundColor $Colors.FilterColor     -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "───────────┐" -ForegroundColor $Colors.BorderColor     -BackgroundColor $Colors.BorderBackColor

    Write-Host " " -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "Item              "  -ForegroundColor $Colors.TextColor   -BackgroundColor $Colors.BackColor -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor
    Write-Host " " -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "Item Selected     "  -ForegroundColor $Colors.SelectedTextColor -BackgroundColor $Colors.SelectedBackColor -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor
    Write-Host " " -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "Item              "  -ForegroundColor $Colors.TextColor   -BackgroundColor $Colors.BackColor -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor
    Write-Host " " -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "Item              "  -ForegroundColor $Colors.TextColor   -BackgroundColor $Colors.BackColor -NoNewLine
    Write-Host "│"                   -ForegroundColor $Colors.BorderColor -BackgroundColor $Colors.BorderBackColor

    Write-Host " " -NoNewLine
    Write-Host "└─"           -ForegroundColor $Colors.BorderColor     -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "[1] 1-4 [4]"  -ForegroundColor $Colors.BorderTextColor -BackgroundColor $Colors.BorderBackColor -NoNewLine
    Write-Host "──────┘"      -ForegroundColor $Colors.BorderColor     -BackgroundColor $Colors.BorderBackColor
}

$themes = (dir .\Documents\WindowsPowerShell\Modules\PowerTab\ColorThemes\*.csv | select -ExpandProperty Name) -replace '.csv',''
$themes = $themes -replace 'Theme',''
$themes | ForEach-Object {
    Import-TabExpansionTheme $_
    Write-Host "Testing Theme $_"
    Write-Host ""
    Show-ConsoleListPreview
    Write-Host ""
    Write-Host ""
}

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0