-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(GH-8503) Add about_Module_Manifests #8696
(GH-8503) Add about_Module_Manifests #8696
Conversation
Docs Build status updates of commit 4351989:
|
File | Status | Preview URL | Details |
---|---|---|---|
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md | View (powershell-5.1) | Details |
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
- Line 1643, Column 1: [Warning: file-not-found - See documentation]
Invalid file link: './About/about_Updatable_Help.md'.
For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the docs.microsoft.com contributor guides
- Post your question in the Docs support channel
4351989
to
788c607
Compare
Docs Build status updates of commit 788c607: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit my review comments and taking a break. I will add more comments later.
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
a module to the PowerShell Gallery. Manifests also give you a simpler way to | ||
implement your module logic, handling requirements, compatibility, loading | ||
order, and more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by "simpler way"? Are you talking about separating module logic from module loading and handling? I think this needs to be clearer.
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
```yaml | ||
Type: System.String | ||
Aliases: ModuleToProcess | ||
Required: False | ||
Default value: None | ||
Accept wildcard characters: False | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert to a table as we discussed.
- Don't use colons since this is now a table.
- Remove
Aliases
since this is the only instance. - Spell out the value of
Required
.- No
- for
Import-Module
- for PowerShell Gallery
- for
Import-Module
and PowerShell Gallery - Add
Applies to
for OS-specific settings
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
To export members from `.psm1` or `.dll` files in a module that has a manifest, | ||
the names of those files must be specified in the values of the **RootModule** | ||
or **NestedModules** keys in the manifest. Otherwise, their members aren't | ||
exported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about cdxml and xaml types, are their values exported differently? In script-based modules, you can use the Export-ModuleMember
cmdlet.
So really, you mean that for exports defined in the manifest, the files containing the items to be exported must be listed in RootModule or NestModules.
#### When RootModule is an empty string | ||
|
||
This module's **ModuleType** is **Manifest**. The only module members this | ||
module can export are those defined in the modules specified for the | ||
**NestedModules** setting. | ||
|
||
```powershell | ||
@{ | ||
RootModule = '' | ||
} | ||
``` | ||
|
||
#### When RootModule is a script module | ||
|
||
This module's **ModuleType** is **Script**. | ||
|
||
```powershell | ||
@{ | ||
RootModule = 'Example.psm1' | ||
} | ||
``` | ||
|
||
#### When RootModule is a binary module | ||
|
||
This module's **ModuleType** is **Binary**. | ||
|
||
```powershell | ||
@{ | ||
RootModule = 'Example.dll' | ||
} | ||
``` | ||
|
||
#### When RootModule is a relative path | ||
|
||
In this example, PowerShell loads `Example.psm1` from the `Files` folder | ||
relative to the `.psd1` manifest file. | ||
|
||
```powershell | ||
@{ | ||
RootModule = 'Files/Example.psm1' | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that these are needed. It seems redundant to the bullet list above.
Docs Build status updates of commit 03eac14: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more comments
### ModuleVersion | ||
|
||
```yaml | ||
Type: System.Version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input type is System.String. The type System.Version is not allowed in restricted language mode or a Data section.
We should be sure that we are documenting the input type. We can talk about how the type changes when imported (as you do below).
PowerShellGet uses the version for module installation. You can use the | ||
`#Requires` statement in a script or the **RequiredModules** setting of another | ||
module manifest to specify minimum, maximum, and ranges of compatible versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to document this here. Module version behavior is covered in those other topics.
#### When ModuleVersion is a valid string | ||
|
||
In this example, the specified string is converted automatically to a | ||
**System.Version** object. | ||
|
||
```powershell | ||
@{ | ||
ModuleVersion = '1.2.3' | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the H4s in this section. Instead, make the description more imparitive. For example,
ModuleVersion must be a string value that that can be converted to to a System.Version type when the module is imported.
I don't think we need to show the negative example.
Because PowerShell automatically converts the value for you, it is not necessary | ||
to cast the string to **System.Version** yourself. | ||
|
||
#### When ModuleVersion cannot be converted to System.Version | ||
|
||
Because the string `a.b.c` specified in this example cannot be converted to a | ||
**System.Version** object, this setting causes both `Test-ModuleManifest` and | ||
`Import-Module` to return an error. | ||
|
||
```powershell | ||
@{ | ||
ModuleVersion = 'a.b.c' | ||
} | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strike
Because PowerShell automatically converts the value for you, it is not necessary | |
to cast the string to **System.Version** yourself. | |
#### When ModuleVersion cannot be converted to System.Version | |
Because the string `a.b.c` specified in this example cannot be converted to a | |
**System.Version** object, this setting causes both `Test-ModuleManifest` and | |
`Import-Module` to return an error. | |
```powershell | |
@{ | |
ModuleVersion = 'a.b.c' | |
} | |
``` |
Specifies the module's compatible PSEditions. If not set, the module is expected | ||
to be compatible for all PSEditions. For information about PSEdition, see | ||
[Modules with compatible PowerShell Editions](/powershell/scripting/gallery/concepts/module-psedition-support). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifies the module's compatible PSEditions. If not set, the module is expected | |
to be compatible for all PSEditions. For information about PSEdition, see | |
[Modules with compatible PowerShell Editions](/powershell/scripting/gallery/concepts/module-psedition-support). | |
Specifies the module's compatible PSEditions. If not set, the module is expected | |
to be compatible for all PSEditions. For information about PSEdition, see: | |
- [about_PowerShell_Editions](about_powershell_editions.md) | |
- [Modules with compatible PowerShell Editions](/powershell/scripting/gallery/concepts/module-psedition-support). |
#### When CompatiblePSEditions is unset | ||
|
||
This module can be imported in both **Desktop Edition** and **Core Edition** | ||
sessions, as well as older versions of Windows PowerShell. | ||
|
||
```powershell | ||
@{ | ||
# CompatiblePSEditions = @() | ||
} | ||
``` | ||
|
||
#### When CompatiblePSEditions is set to Desktop | ||
|
||
This module can only be imported in Windows PowerShell sessions where the | ||
`$PSEdition` automatic variable's value is `Desktop`. | ||
|
||
```powershell | ||
@{ | ||
CompatiblePSEditions = @('Desktop') | ||
} | ||
``` | ||
|
||
#### When CompatiblePSEditions is set to Core | ||
|
||
This module can only be imported in sessions where the `$PSEdition` automatic | ||
variable's value is `Core`. | ||
|
||
```powershell | ||
@{ | ||
CompatiblePSEditions = @('Core') | ||
} | ||
``` | ||
|
||
#### When CompatiblePSEditions is set to Desktop and Core | ||
|
||
This module can only be imported in sessions where the `$PSEdition` automatic | ||
variable exists. | ||
|
||
```powershell | ||
@{ | ||
CompatiblePSEditions = @('Desktop', 'Core') | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditch the H4s. Make the description more imperative. Don't need to show all 4 possible combinations. Just explain that "Undefined is the same as @('Desktop', 'Core')
.
An empty array is allowed. Do we know if that is the same as both? Or what does it mean to be 'none'?
Docs Build status updates of commit 3f6c0f3:
|
File | Status | Preview URL | Details |
---|---|---|---|
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md | View (powershell-5.1) | Details |
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
- Line 207, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
- Line 1478, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the docs.microsoft.com contributor guides
- Post your question in the Docs support channel
Docs Build status updates of commit eac3376:
|
File | Status | Preview URL | Details |
---|---|---|---|
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md | View (powershell-5.1) | Details |
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
- Line 207, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
- Line 1478, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the docs.microsoft.com contributor guides
- Post your question in the Docs support channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking much better. Try to separate consecutive alert blocks.
> [!NOTE] | ||
> This setting may also be specified in module manifests as **ModuleToProcess**. | ||
> While that name for this setting is valid, it is best practice to use | ||
> **RootModule** instead. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back-to-back alerts look messy. Move this one after the example and before the next H3
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
Docs Build status updates of commit bea7a4e:
|
File | Status | Preview URL | Details |
---|---|---|---|
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md | View (powershell-5.1) | Details |
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
- Line 207, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
- Line 1478, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the docs.microsoft.com contributor guides
- Post your question in the Docs support channel
bea7a4e
to
fbe279b
Compare
Docs Build status updates of commit fbe279b:
|
File | Status | Preview URL | Details |
---|---|---|---|
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md | View (powershell-5.1) | Details |
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
- Line 207, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
- Line 1470, Column 3: [Warning: file-not-found - See documentation]
Invalid file link: 'about_powershell_editions.md'.
For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the docs.microsoft.com contributor guides
- Post your question in the Docs support channel
fbe279b
to
b4804bd
Compare
Docs Build status updates of commit b4804bd: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
b4804bd
to
92d4447
Compare
Docs Build status updates of commit 92d4447: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifest.md
Outdated
Show resolved
Hide resolved
Docs Build status updates of commit 97c6119: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
Docs Build status updates of commit b566cee: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
This commit adds the `about_Module_Manifests` help topic, explaining the available settings and how to use them in detail.
b566cee
to
f16e7f6
Compare
Docs Build status updates of commit f16e7f6: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
PR Summary
Adds the
about_Module_Manifests
topic.PR Context
Check the boxes below to indicate the content affected by this PR.
Repository or docset configuration
Conceptual documentation
Cmdlet reference & about_ topics
When changing cmdlet reference or about_ topics, the changes should be copied to all
relevant versions. Check the boxes below to indicate the versions affected by this change.
PR Checklist
please add the prefix
WIP:
or[WIP]
to the beginning of the title and remove the prefix whenthe PR is ready.