Title: Import-Module with -UseWindowsPowerShell and PSModuleAutoLoadingPreference=None silently fails to create proxies · Issue #12043 · PowerShell/PowerShell · GitHub
Open Graph Title: Import-Module with -UseWindowsPowerShell and PSModuleAutoLoadingPreference=None silently fails to create proxies · Issue #12043 · PowerShell/PowerShell
X Title: Import-Module with -UseWindowsPowerShell and PSModuleAutoLoadingPreference=None silently fails to create proxies · Issue #12043 · PowerShell/PowerShell
Description: I've been trying to find some kind of practical workaround for the name collisions described in #12036 and #12014. One avenue that seemed worth exploring is setting $PSModuleAutoLoadingPreference to None and explicitly importing required...
Open Graph Description: I've been trying to find some kind of practical workaround for the name collisions described in #12036 and #12014. One avenue that seemed worth exploring is setting $PSModuleAutoLoadingPreference t...
X Description: I've been trying to find some kind of practical workaround for the name collisions described in #12036 and #12014. One avenue that seemed worth exploring is setting $PSModuleAutoLoadingPreferen...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12043
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Import-Module with -UseWindowsPowerShell and PSModuleAutoLoadingPreference=None silently fails to create proxies","articleBody":"I've been trying to find some kind of practical workaround for the name collisions described in #12036 and #12014. One avenue that seemed worth exploring is setting `$PSModuleAutoLoadingPreference` to `None` and explicitly importing required modules into each module. Turning off module auto-loading, however, seems to result in the silent failure of `Import-Module -UseWindowsPowerShell`. Proxy commands in that condition don't seems to be created despite that `Import-Module -UseWinidowsPowerShell` produces no error.\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\n$PSModuleAutoLoadingPreference = [System.Management.Automation.PSModuleAutoLoadingPreference]::None\r\nImport-Module Microsoft.PowerShell.Utility,Microsoft.PowerShell.Management\r\nImport-Module Microsoft.PowerShell.Management -UseWindowsPowerShell -wa si\r\nGet-Command Get-WmiObject\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\nFunction\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\nGet-Command: C:\\test.ps1:4\r\nLine |\r\n 4 | Get-Command Get-WmiObject | % CommandType\r\n | ~~~~~~~~~~~~~~~~~~~~~~~~~\r\n | The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.\r\n | Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.0.0\r\nPSEdition Core\r\nGitCommitId 7.0.0\r\nOS Microsoft Windows 6.3.9600\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","author":{"url":"https://github.com/alx9r","@type":"Person","name":"alx9r"},"datePublished":"2020-03-05T23:55:30Z","url":"https://github.com/PowerShell/PowerShell/issues/12043"}
| 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:29b4f4f1-54bb-6cc1-9621-4e503d5a59a0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D24C:D86A9:A1AFB:D8DB0:6AFD3E1D |
| html-safe-nonce | c559e6fd102a52e018cd78459683be8ecf387385a23f2976ac217f80dfe44183 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjRDOkQ4NkE5OkExQUZCOkQ4REIwOjZBRkQzRTFEIiwidmlzaXRvcl9pZCI6IjY4Njk4NTUyOTYxNzczODkwODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f2799e48542f371926bb250cb5d67d8e86154b4046e1e71755ceaf62e29c34e0 |
| hovercard-subject-tag | issue:576601851 |
| 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/12043/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bffda34a90a57e214ffeb6face7615f7e310d0857fc501a1af7686faa83f0d5d/PowerShell/PowerShell/issues/12043 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bffda34a90a57e214ffeb6face7615f7e310d0857fc501a1af7686faa83f0d5d/PowerShell/PowerShell/issues/12043 |
| og:image:alt | I've been trying to find some kind of practical workaround for the name collisions described in #12036 and #12014. One avenue that seemed worth exploring is setting $PSModuleAutoLoadingPreference t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alx9r |
| 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