Title: Current module manifest schema is not adequate to properly support cross-platform modules · Issue #5541 · PowerShell/PowerShell · GitHub
Open Graph Title: Current module manifest schema is not adequate to properly support cross-platform modules · Issue #5541 · PowerShell/PowerShell
X Title: Current module manifest schema is not adequate to properly support cross-platform modules · Issue #5541 · PowerShell/PowerShell
Description: It is not going to be uncommon for module authors to want to provide slightly different functionality on different operating systems e.g. the module provides 30 commands, two of which only work on Windows PowerShell. Right now, there is ...
Open Graph Description: It is not going to be uncommon for module authors to want to provide slightly different functionality on different operating systems e.g. the module provides 30 commands, two of which only work on ...
X Description: It is not going to be uncommon for module authors to want to provide slightly different functionality on different operating systems e.g. the module provides 30 commands, two of which only work on ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5541
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Current module manifest schema is not adequate to properly support cross-platform modules","articleBody":"It is not going to be uncommon for module authors to want to provide slightly different functionality on different operating systems e.g. the module provides 30 commands, two of which only work on Windows PowerShell. Right now, there is no good way to declare \"conditional\" module exports in the manifest where the condition is the OS platform. \r\n\r\nIn fact, even `PowerShellVersion` is problematic if you design your module to load into both Windows PowerShell and PowerShell Core. Which PowerShell version does that refer to? Windows PowerShell? PowerShell Core? What if at some point, on PS Core I require 6.1.0? Does that mean my module can't load into Windows PowerShell 5.x anymore - probably. But I may not be providing that functionality when I'm loaded into Windows PowerShell (runtime decision) so Win PS 5.1 should be allowed when loading into Windows PowerShell.\r\n\r\nAFAICT all of these field's values may be conditional upon the OS platform and/or the PowerShell platform (Win or Core)\r\n\r\n* PowerShellVersion\r\n* PowerShellHostName / Version\r\n* RequiredAssemblies\r\n* RequiredModules\r\n* ModuleList\r\n* NestedModules\r\n* FormatsToProcess\r\n* ScriptsToProcess\r\n* TypesToProcess\r\n* ClrVersion\r\n* DotNetFrameworkVersion\r\n* AliasesToExport although CompatiblePSEditions might mitigate this one\r\n* CmdletsToExport\r\n* FunctionsToExport\r\n* VariablesToExport\r\n* Tags\r\n\r\nIn order to make any changes backwards compatible with existing Windows PowerShell instance, we could put all the conditional declarations in PrivateData. This implies that fields not in PrivateData inherently apply to Windows PowerShell when module is loaded by Windows PowerShell. PowerShell Core could be modified to process the conditional fields in PrivateData. What might those look like? Maybe this?\r\n\r\n```\r\n PrivateData = @{\r\n PSManifestEx = @{\r\n PowerShellVersion = \"6.1.0\" # fields at this level apply to all OS platforms for PS Core\r\n Linux = @{\r\n RequiredModules = @(...)\r\n CmdletsToExport = @(...)\r\n }\r\n MacOS = @{\r\n RequiredModules = @(...)\r\n CmdletsToExport = @(...)\r\n }\r\n Windows = @{ # this is for PowerShell Core on Windows\r\n RequiredModules = @(...)\r\n CmdletsToExport = @(...)\r\n }\r\n }\r\n```\r\nThis doesn't take into account Nano server which I don't have enough experience with to take it into account. Anyway, this is just something to get the conversation started.\r\n\r\nLong term, this approach seems less than ideal - burying so much important metadata under `PrivateData`.\r\n","author":{"url":"https://github.com/rkeithhill","@type":"Person","name":"rkeithhill"},"datePublished":"2017-11-25T00:53:17Z","url":"https://github.com/PowerShell/PowerShell/issues/5541"}
| 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:4ec60ef9-65b8-72ea-d6d6-f2e994797480 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2EC:24D490:AA139:E8A2E:6AFD4A0E |
| html-safe-nonce | 08c3f007f7d6447c42f6856adb2dbb0becdf3039c8f910fb276a3036eaa8a68e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkVDOjI0RDQ5MDpBQTEzOTpFOEEyRTo2QUZENEEwRSIsInZpc2l0b3JfaWQiOiIxMTYwNTY0NDEzNTg5OTY1MzI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e900d81f3d3b4e0f0ae164700fa35747dbd52da4103b2e6b29d810bb9af90cc3 |
| hovercard-subject-tag | issue:276715002 |
| 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/5541/issue_layout |
| twitter:image | https://opengraph.githubassets.com/192712c9a1d05b54790b35b77e5fbec77e0f93ec430516809537e7c46d46ef2d/PowerShell/PowerShell/issues/5541 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/192712c9a1d05b54790b35b77e5fbec77e0f93ec430516809537e7c46d46ef2d/PowerShell/PowerShell/issues/5541 |
| og:image:alt | It is not going to be uncommon for module authors to want to provide slightly different functionality on different operating systems e.g. the module provides 30 commands, two of which only work on ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rkeithhill |
| 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