нашел воть это:
"In the ISE - as opposed to a regular PowerShell console window,
# !! $host.UI.RawUI.ForegroundColor and $host.UI.RawUI.ForegroundColor inexcplicably
# !! report value -1, which causes an error when passed to Write-Host.
# !! Thus, we only specify the -ForegroundColor and -BackgroundColor parameters
# !! for values other than -1.
# !! Similarly, PowerShell Core terminal windows on *Unix* report -1 too."