Open
Description
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 ""
}