Title: PowerShell installed as a .NET global tool cannot invoke its own CLI on macOS · Issue #12205 · PowerShell/PowerShell · GitHub
Open Graph Title: PowerShell installed as a .NET global tool cannot invoke its own CLI on macOS · Issue #12205 · PowerShell/PowerShell
X Title: PowerShell installed as a .NET global tool cannot invoke its own CLI on macOS · Issue #12205 · PowerShell/PowerShell
Description: When PowerShell is installed as a .NET global tool, it prepends its own $PSHOME folder to $env:PATH. However, on macOS $PSHOME contains an incompatible pwsh binary that is for Linux. Therefore, from within an existing session, invoking p...
Open Graph Description: When PowerShell is installed as a .NET global tool, it prepends its own $PSHOME folder to $env:PATH. However, on macOS $PSHOME contains an incompatible pwsh binary that is for Linux. Therefore, fro...
X Description: When PowerShell is installed as a .NET global tool, it prepends its own $PSHOME folder to $env:PATH. However, on macOS $PSHOME contains an incompatible pwsh binary that is for Linux. Therefore, fro...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12205
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PowerShell installed as a .NET global tool cannot invoke its own CLI on macOS","articleBody":"When PowerShell is installed as a .NET global tool, it prepends its own `$PSHOME` folder to `$env:PATH`.\r\n\r\nHowever, on macOS `$PSHOME` contains an _incompatible_ `pwsh` binary that is for _Linux_.\r\n\r\nTherefore, from within an existing session, invoking `pwsh` (by mere file _name_) unexpectedly fails.\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\n# Install PowerShell as a .NET global tool, to ~/.dotnet/tools\r\ndotnet tool install powershell -g\r\n\r\n# Invoke it, and try to re-invoke its own CLI.\r\n~/.dotnet/tools/pwsh -noprofile -c 'pwsh -noprofile -c write-output hi' | Should -Be 'hi'\r\n```\r\n\r\n# Expected behavior\r\n\r\nThe test should succeed.\r\n\r\n# Actual behavior\r\n\r\nThe test fails, due to incompatible binary being invoked:\r\n\r\n```none\r\nExpected 'hi', but got @('ResourceUnavailable: Program 'pwsh' failed to run: Exec format errorAt line:1 char:1' ...\r\n```\r\n\r\n# Environment data\r\n\r\n\r\n```none\r\nPowerShell Core v7.0.0 (7.0.0) on macOS 10.15.3\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2020-03-25T20:43:06Z","url":"https://github.com/PowerShell/PowerShell/issues/12205"}
| 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:369557b7-e53d-94f6-8f56-88827411b729 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B600:253A9A:2862FC:3629FA:6AFD35C3 |
| html-safe-nonce | aa9eb85fb53fd7aebf1e65f40a0244b378aade1d94c1844bba1105fb45a568c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjAwOjI1M0E5QToyODYyRkM6MzYyOUZBOjZBRkQzNUMzIiwidmlzaXRvcl9pZCI6IjY5MzE4ODM5OTEyNTUyOTk1MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1f492bd62542c9c5dfdc06095c7d9711ac37e9feef51978271f631f1eb8c4c68 |
| hovercard-subject-tag | issue:587978897 |
| 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/12205/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9757b7e349b4791eea872e4a22d5d610e848b30b5fbc01437ce9910d523593a3/PowerShell/PowerShell/issues/12205 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9757b7e349b4791eea872e4a22d5d610e848b30b5fbc01437ce9910d523593a3/PowerShell/PowerShell/issues/12205 |
| og:image:alt | When PowerShell is installed as a .NET global tool, it prepends its own $PSHOME folder to $env:PATH. However, on macOS $PSHOME contains an incompatible pwsh binary that is for Linux. Therefore, fro... |
| 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 | 065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19 |
| 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 | 941021edf0c2ec58298f4a2c8f27ae507d129c92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width