Title: Enter-PSSession - Clear-Host from non-Windows client to Windows target fails · Issue #28115 · PowerShell/PowerShell · GitHub
Open Graph Title: Enter-PSSession - Clear-Host from non-Windows client to Windows target fails · Issue #28115 · PowerShell/PowerShell
X Title: Enter-PSSession - Clear-Host from non-Windows client to Windows target fails · Issue #28115 · 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/28115
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enter-PSSession - Clear-Host from non-Windows client to Windows target fails","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\nWhen targeting a Windows host from a non-Windows host through `Enter-PSSession` calling `Clear-Host` fails. The `Clear-Host` implementation on a Windows target runs the following script:\n\n```powershell\n# ${function:Clear-Host}\n\n$RawUI = $Host.UI.RawUI\n$RawUI.CursorPosition = @{X=0;Y=0}\n$RawUI.SetBufferContents(\n @{Top = -1; Bottom = -1; Right = -1; Left = -1},\n @{Character = ' '; ForegroundColor = $rawui.ForegroundColor; BackgroundColor = $rawui.BackgroundColor})\n# .Link\n# https://go.microsoft.com/fwlink/?LinkID=2096480\n# .ExternalHelp System.Management.Automation.dll-help.xml\n```\n\nCalling this in a remote PSSession will send the host method call back to the client which is fine with Windows client but a non-Windows client [SetBufferContents for `UNIX`](https://github.com/PowerShell/PowerShell/blob/0b909d0eba6ce8a4a38b0d4a867208ff4296b1e5/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs#L1650-L1660) throws a `NotImplementedException`. The `CursorPosition` does still work but the contents are not cleared.\n\n### Expected behavior\n\n```console\nThe console is cleared and the cursor set back to position `0, 0`.\n```\n\n### Actual behavior\n\n```console\nThe cursor position is set back to `0, 0`, `The method or operation is not implemented.` is displayed and original content is not cleared.\n```\n\n### Error details\n\n```console\nNo explicit error for `Get-Error` as the exception isn't sent back to the remote session and just printed on the screen.\n\n> The method or operation is not implemented.\n```\n\n### Environment data\n\n```powershell\nAll Powershell 7.x versions.\n```\n\n### Visuals\n\nThe below example shows what happens on a Linux client connecting to Windows.\n\nhttps://github.com/user-attachments/assets/f47446f6-5293-48a5-8fa4-c62d0823df84\n\nThe same error occurs regardless of the transport protocol used.","author":{"url":"https://github.com/jborean93","@type":"Person","name":"jborean93"},"datePublished":"2026-09-28T11:00:54Z","url":"https://github.com/PowerShell/PowerShell/issues/28115"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:55f49cff-0b59-761f-fb0f-7fc6342b9e38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB7A:23D291:59BDE:7CB63:6AFD594C |
| html-safe-nonce | 122ed0888d2c65aaa82557d11987ed5ad239eaad003e64b099ed1a7cf823088f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjdBOjIzRDI5MTo1OUJERTo3Q0I2Mzo2QUZENTk0QyIsInZpc2l0b3JfaWQiOiI4NDMzMzMyMTY2MjYzMTM0NTQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c770f813e854aa1e66e1548fc90f6e108d5e03a0c1f782ccd0b5679f468b61d6 |
| hovercard-subject-tag | issue:5613441891 |
| 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/28115/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d379594694a098f8b527f29d70ef8e1994380bb69357d7e5e56c8219b37d582/PowerShell/PowerShell/issues/28115 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d379594694a098f8b527f29d70ef8e1994380bb69357d7e5e56c8219b37d582/PowerShell/PowerShell/issues/28115 |
| 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 | jborean93 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width