Title: PSCore: Linux - Clear-Host injects data into function return value · Issue #10181 · PowerShell/PowerShell · GitHub
Open Graph Title: PSCore: Linux - Clear-Host injects data into function return value · Issue #10181 · PowerShell/PowerShell
X Title: PSCore: Linux - Clear-Host injects data into function return value · Issue #10181 · PowerShell/PowerShell
Description: Steps to reproduce Function Get-SomeData { Clear-Host $somedata="somedata" return $somedata } $myData = Get-SomeData $myData[0] # will clear the screen $myData[1] # "somedata" $myData.Count # will be 2 Expected behavior Function should r...
Open Graph Description: Steps to reproduce Function Get-SomeData { Clear-Host $somedata="somedata" return $somedata } $myData = Get-SomeData $myData[0] # will clear the screen $myData[1] # "somedata" $myData.Count # will ...
X Description: Steps to reproduce Function Get-SomeData { Clear-Host $somedata="somedata" return $somedata } $myData = Get-SomeData $myData[0] # will clear the screen $myData[1] # "somedata" $...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10181
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PSCore: Linux - Clear-Host injects data into function return value","articleBody":"\u003c!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\nWindows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nThis repository is **ONLY** for PowerShell Core 6 issues.\r\n\r\n- Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- Search the existing issues.\r\n- Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6).\r\n\r\n-->\r\n\r\n# Steps to reproduce\r\n\r\n```\r\nFunction Get-SomeData {\r\n Clear-Host\r\n $somedata=\"somedata\"\r\n return $somedata\r\n}\r\n\r\n$myData = Get-SomeData\r\n\r\n$myData[0] # will clear the screen\r\n$myData[1] # \"somedata\"\r\n$myData.Count # will be 2\r\n\r\n```\r\n\r\n# Expected behavior\r\n\r\n```\r\nFunction should return a single value (\"somedata\")\r\n```\r\n\r\n# Actual behavior\r\n\r\n```\r\nFunction returns an array with the Clear-Host command as the first object\r\n\r\n```\r\n\r\n# Environment data\r\nVerified in:\r\n|Name|Value|\r\n|---|---|\r\n|PSVersion|6.2.0|\r\n|PSEdition|Core|\r\n|GitCommitId|6.2.0|\r\n|OS|Linux 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019|\r\n|Platform|Unix|\r\n|PSCompatibleVersions|1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.2.0|\r\n|PSRemotingProtocolVersion|2.3|\r\n|SerializationVersion|1.1.0.1|\r\n|WSManStackVersion|3.0|\r\n","author":{"url":"https://github.com/tobyscales","@type":"Person","name":"tobyscales"},"datePublished":"2019-07-19T00:10:25Z","url":"https://github.com/PowerShell/PowerShell/issues/10181"}
| 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:96c1b35d-3ae6-7bd6-45fc-a6c37bb63e93 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B090:3C18DC:FB5E1:167FA3:6AFD4CC9 |
| html-safe-nonce | a4c7b905939560adafb5b0f0cd1ab1838cad13b8ebf7b773f20a8121ed6c731f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDkwOjNDMThEQzpGQjVFMToxNjdGQTM6NkFGRDRDQzkiLCJ2aXNpdG9yX2lkIjoiNDgwNjc1NzUyNDkzMTY5Mzc2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6dbeafcf66d827da5e9ad45b9e95355ec3a0cee6c074ca68e8e011560a9e83f8 |
| hovercard-subject-tag | issue:470060808 |
| 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/10181/issue_layout |
| twitter:image | https://opengraph.githubassets.com/91271c4712fd2708b9487aadd570e44c46b9556eb3c794dcf0393f27d8e4e6e2/PowerShell/PowerShell/issues/10181 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/91271c4712fd2708b9487aadd570e44c46b9556eb3c794dcf0393f27d8e4e6e2/PowerShell/PowerShell/issues/10181 |
| og:image:alt | Steps to reproduce Function Get-SomeData { Clear-Host $somedata="somedata" return $somedata } $myData = Get-SomeData $myData[0] # will clear the screen $myData[1] # "somedata" $myData.Count # will ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tobyscales |
| 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