Software - Output Console window

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
angelofstealth
Posts: 69
Last visit: Wed Sep 28, 2022 10:04 am

Software - Output Console window

Post by angelofstealth »

In Sapien PowerShell Studio, writing a powershell script........

Using Write-Host to display a message to the Output doesn't seem to take background color or newline (`r`n). Is there something I need to enable in the options to allow this? Running in PowerShell ISE has no issues. Thanks,
User avatar
angelofstealth
Posts: 69
Last visit: Wed Sep 28, 2022 10:04 am

Re: Software - Output Console window

Post by angelofstealth »

Newline works, color doesn't

Example:
Write-Host "`r`nHey..."-ForegroundColor Green
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Software - Output Console window

Post by jvierra »

It works for me with no issue.

The "Output" panel is not a console. Use the "Run" drop down to select "Run in console" and all will work.
User avatar
angelofstealth
Posts: 69
Last visit: Wed Sep 28, 2022 10:04 am

Re: Software - Output Console window

Post by angelofstealth »

Thank you jvierra, I'm all good now.
This topic is 5 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked