Title: In remoting calls, combining the $using: scope with namespace variable notation is quietly ignored · Issue #16019 · PowerShell/PowerShell · GitHub
Open Graph Title: In remoting calls, combining the $using: scope with namespace variable notation is quietly ignored · Issue #16019 · PowerShell/PowerShell
X Title: In remoting calls, combining the $using: scope with namespace variable notation is quietly ignored · Issue #16019 · 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/16019
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"In remoting calls, combining the $using: scope with namespace variable notation is quietly ignored","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nPossibly related: #9204\r\n\r\nUsing namespace variable notation in combination with the `$using:` scope works as expected with _jobs_; e.g.:\r\n\r\n```powershell\r\n$env:FOO = 'bar'\r\n# Outputs 'bar', as expected.\r\nStart-Job { $using:env:FOO } | Receive-Job -Wait -AutoRemoveJob\r\n```\r\n\r\nBy contrast, in the context of _remoting_ it fails quietly (the reference evaluates to `$null`):\r\n\r\n```powershell\r\n# Run from an elevated session on a machine with remoting enabled.\r\n$env:FOO = 'bar'\r\nInvoke-Command -ComputerName . { $using:env:FOO }\r\n```\r\n\r\n\r\n\r\n\r\n### Expected behavior\r\n\r\n`'bar'` should print.\r\n\r\n\r\n### Actual behavior\r\n\r\nNothing is output.\r\n\r\n\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPowerShell Core 7.2.0-preview.9\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2021-08-30T18:06:08Z","url":"https://github.com/PowerShell/PowerShell/issues/16019"}
| 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:8c066f77-9ce9-cf71-6ec9-8784d0b80181 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2E0:257D2B:593A7E:7B6075:6AFDEA8A |
| html-safe-nonce | 008adee860381fc393606d0e0bf0b9068aaf9299cf8101832d69530f728f3172 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkUwOjI1N0QyQjo1OTNBN0U6N0I2MDc1OjZBRkRFQThBIiwidmlzaXRvcl9pZCI6IjUzODQwMTY5MzQ5OTM3ODM0MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bce0a85f98e708debbb4c9002186cfb20eee8a4ad0771d41e874f35c415fbfef |
| hovercard-subject-tag | issue:983059379 |
| 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/16019/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6392b38580a2e5d2129ea77c7a91acbf8ee37cfe8ad52b3dc5570ce820a12133/PowerShell/PowerShell/issues/16019 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6392b38580a2e5d2129ea77c7a91acbf8ee37cfe8ad52b3dc5570ce820a12133/PowerShell/PowerShell/issues/16019 |
| 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 | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 91ef1a291a064ac31ac459ab3f75261dbdd924c41ea5bd027e591c5b46cc9ce7 |
| 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 | d62bc98ce2346f4006e4a2810e9e22f37e7e6422 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width