Title: powershell.exe still receives PSModulePath for pwsh when called indirectly · Issue #12997 · PowerShell/PowerShell · GitHub
Open Graph Title: powershell.exe still receives PSModulePath for pwsh when called indirectly · Issue #12997 · PowerShell/PowerShell
X Title: powershell.exe still receives PSModulePath for pwsh when called indirectly · Issue #12997 · PowerShell/PowerShell
Description: I know why this is happening given how #11057 was implemented. Is there any sort of workaround, other than explicitly resetting the PSModulePath in the Windows Powershell script? Steps to reproduce Set up invocation of powershell.exe in ...
Open Graph Description: I know why this is happening given how #11057 was implemented. Is there any sort of workaround, other than explicitly resetting the PSModulePath in the Windows Powershell script? Steps to reproduce...
X Description: I know why this is happening given how #11057 was implemented. Is there any sort of workaround, other than explicitly resetting the PSModulePath in the Windows Powershell script? Steps to reproduce...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"powershell.exe still receives PSModulePath for pwsh when called indirectly","articleBody":"I know why this is happening given how #11057 was implemented. Is there any sort of workaround, other than explicitly resetting the PSModulePath in the Windows Powershell script?\r\n\r\n## Steps to reproduce\r\n\r\n1. Set up invocation of powershell.exe in some sort of non-PS tool. In my case, a post-action on a `dotnet new` template.\r\n\r\n```\r\n {\r\n \"actionId\": \"3A7C4B45-1F5D-4A30-959A-51B88E82B5D2\",\r\n \"args\": {\r\n \"executable\": \"powershell\",\r\n \"args\": \"-File init.ps1 \"\r\n },\r\n \"manualInstructions\": [{\r\n \"text\": \"Run 'init.ps1'\"\r\n }],\r\n \"continueOnError\": false,\r\n \"description \": \"Initializes something.\"\r\n }\r\n```\r\n1. Invoke the above from pwsh.\r\n\r\n## Expected behavior\r\n\r\npowershell.exe has correct PSModulePath.\r\n\r\n## Actual behavior\r\n\r\npowershell.exe still has PS7 values in PSModulePath.\r\n\r\n```none\r\nC:\\path\\to\\init.ps1 : C:\\Users\\nwe\\Documents\\PowerShell\\Modules;C:\\Program Files\\PowerShell\\Modules;c:\\program\r\nfiles\\powershell\\7\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft SQL\r\nServer\\140\\Tools\\PowerShell\\Modules\\\r\n```\r\n\r\n## Environment data\r\n\r\n```none\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.0.2\r\nPSEdition Core\r\nGitCommitId 7.0.2\r\nOS Microsoft Windows 10.0.18363\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\n```\r\n","author":{"url":"https://github.com/nickwesselman","@type":"Person","name":"nickwesselman"},"datePublished":"2020-06-19T13:52:02Z","url":"https://github.com/PowerShell/PowerShell/issues/12997"}
| 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:4579b753-4a8b-47eb-61be-c68545ec80ae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFDC:14E64C:3C51B:523E9:6AFD39BD |
| html-safe-nonce | 43c9b969e20665ff700de1f80ae385a79b05afe3e921f16af53cd5d58e2b2538 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkRDOjE0RTY0QzozQzUxQjo1MjNFOTo2QUZEMzlCRCIsInZpc2l0b3JfaWQiOiI1OTA1OTMxNzUyOTYxODE3MDIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1523dc8e7a489339ac4322be0fd5d24e6a1cd094e8c0833891faa984f19ab043 |
| hovercard-subject-tag | issue:641985921 |
| 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/12997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e33297cadab9023057a5e282b162f45d7fdba6850ff6b8c9df382de9ceb2c9b7/PowerShell/PowerShell/issues/12997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e33297cadab9023057a5e282b162f45d7fdba6850ff6b8c9df382de9ceb2c9b7/PowerShell/PowerShell/issues/12997 |
| og:image:alt | I know why this is happening given how #11057 was implemented. Is there any sort of workaround, other than explicitly resetting the PSModulePath in the Windows Powershell script? Steps to reproduce... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nickwesselman |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| 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 | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width