BlueTuxedo icon indicating copy to clipboard operation
BlueTuxedo copied to clipboard

🪲 Show-BTLogo fails in PowerShell ISE

Open SamErde opened this issue 1 year ago • 1 comments

When running BlueTuxedo straight from the PowerShell ISE, the Show-Logo function returns an error whenever it tries to reset the background color.

PS C:\Tools> .\Invoke-BlueTuxedov2024.10-4dev.ps1
Write-Host : Cannot process the color because -1 is not a valid color.
Parameter name: value
Actual value was -1.
At C:\Tools\Invoke-BlueTuxedov2024.10-4dev.ps1:1461 char:5
+     Write-Host ' ' -BackgroundColor $BGColor
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Write-Host], ArgumentOutOfRangeException
    + FullyQualifiedErrorId : SetInvalidBackgroundColor,Microsoft.PowerShell.Commands.WriteHostCommand
 
        :::::::::  :::       :::    ::: :::::::::: ::::::::::: :::    ::: :::    ::: :::::::::: :::::::::   ::::::::

Apparently, the ISE returns nothing for $host.UI.RawUI.BackgroundColor. Will need to either find a different method to check the ISE background color or just assume the default blue background for now.

SamErde avatar Oct 04 '24 16:10 SamErde

Oh dang. I just figured out how to do this the other day but thought "why would I ever need this?"

jakehildreth avatar Oct 04 '24 19:10 jakehildreth