Title: Changing on write-host the background color, foreground color is ignored · Issue #25062 · PowerShell/PowerShell · GitHub
Open Graph Title: Changing on write-host the background color, foreground color is ignored · Issue #25062 · PowerShell/PowerShell
X Title: Changing on write-host the background color, foreground color is ignored · Issue #25062 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/25062
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Changing on write-host the background color, foreground color is ignored ","articleBody":"### Prerequisites\n\n- [x] Write a descriptive title.\n- [x] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [x] Search the existing issues.\n- [x] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [x] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\nWrite-Host -NoNewline -BackgroundColor \"green\" -ForegroundColor 'Yellow' -Object ${Message}\n\nThe foreground is not yellow!\n\n\n\n### Expected behavior\n\n```console\na yellow foreground color\n```\n\n### Actual behavior\n\n```console\na black foreground color\n```\n\n### Error details\n\n```console\nthere is no error at all\n```\n\n### Environment data\n\n```powershell\nName Value\n---- -----\nPSVersion 7.4.6\nPSEdition Core\nGitCommitId 7.4.6\nOS Microsoft Windows 10.0.20348\nPlatform Win32NT\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nPSRemotingProtocolVersion 2.3\nSerializationVersion 1.1.0.1\nWSManStackVersion 3.0\n```\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/fceledon","@type":"Person","name":"fceledon"},"datePublished":"2025-02-21T00:15:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/25062/PowerShell/issues/25062"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b899fbc3-5212-52d9-a216-734affa12bd9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E562:CD74F:1800BE6:231584E:6A5636F2 |
| html-safe-nonce | fcc0fdf286e9f99b8dafa611f1f8ddf70a808c2fb38ae38979a6c2e0550b5f8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTYyOkNENzRGOjE4MDBCRTY6MjMxNTg0RTo2QTU2MzZGMiIsInZpc2l0b3JfaWQiOiI0NTIxNTQwNTE1MDAzNzc0NzA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b7274c303a7306c0331e04727d8f654269e60c3928aafbc92f300e2bee47ae94 |
| hovercard-subject-tag | issue:2867563778 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/25062/issue_layout |
| twitter:image | https://opengraph.githubassets.com/37b3acc6506c3f4c47f1547398e9a24a3c32ec0aad17cf680eb18641913ba801/PowerShell/PowerShell/issues/25062 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/37b3acc6506c3f4c47f1547398e9a24a3c32ec0aad17cf680eb18641913ba801/PowerShell/PowerShell/issues/25062 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fceledon |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d78ea552aac0685ca5f006d44f88166cbbf3bb96843f8da0c5a2c0b9908430b |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423b2fb76ac2b90de5ab599b7a76a0d2b2c83f24 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width