Skip to content

invoke-psake fails under environments which dont support colored consoles #48

Closed
jeffreyabecker opened this Issue Sep 18, 2012 · 4 comments

3 participants

@jeffreyabecker

When invoking psake from a C# host, colored consoles are not supported. Write-ColoredOutput fails to check for ($Host.UI.RawUI.ForegroundColor -ne $null) before setting the ForegroundColor.

A pull request fixing this issue will be forthcoming.

@damianh damianh added the UpForGrabs label Mar 31, 2014
@damianh
psake member
damianh commented Mar 31, 2014

Will accept a PR for this.

@togakangaroo

Is this already fixed? Sat down to look at it and see this code:

    if (($Host.UI -ne $null) -and ($Host.UI.RawUI -ne $null) -and ($Host.UI.RawUI.ForegroundColor -ne $null)) {
        $previousColor = $Host.UI.RawUI.ForegroundColor
        $Host.UI.RawUI.ForegroundColor = $foregroundcolor
    }
@jeffreyabecker
@togakangaroo

This needs to get closed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.