Skip to content

Commit a440625

Browse files
authored
Fixes #10137 - Add notes about other PSData usage (#10249)
* Add notes about other PSData usage * fix urls
1 parent 9f4649b commit a440625

File tree

4 files changed

+266
-136
lines changed

4 files changed

+266
-136
lines changed

reference/5.1/Microsoft.PowerShell.Core/About/about_Module_Manifests.md

Lines changed: 62 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes the settings and practices for writing module manifest files.
33
Locale: en-US
4-
ms.date: 06/07/2023
4+
ms.date: 07/07/2023
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_module_manifests?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about Module Manifests
@@ -100,7 +100,7 @@ Allowed variables
100100
- `$EnabledExperimentalFeatures`
101101
- Any environment variables, like `$ENV:TEMP`
102102

103-
For more information, see [about_Language_Modes](about_Language_Modes.md).
103+
For more information, see [about_Language_Modes][08].
104104

105105
## Manifest settings
106106

@@ -158,7 +158,7 @@ By default, all module members in the **RootModule** are exported.
158158
> [!TIP]
159159
> Module loading speed differs between **Binary**, **Script**, and **CIM**
160160
> module types. For more information, see
161-
> [PowerShell module authoring considerations][03]
161+
> [PowerShell module authoring considerations][05]
162162
163163
For example, this module's **ModuleType** is **Manifest**. The only module
164164
members this module can export are those defined in the modules specified with
@@ -234,8 +234,8 @@ values.
234234

235235
For information about PSEdition, see:
236236

237-
- [about_PowerShell_Editions][02]
238-
- [Modules with compatible PowerShell Editions][05].
237+
- [about_PowerShell_Editions][04]
238+
- [Modules with compatible PowerShell Editions][02].
239239

240240
When this setting is defined, the module can only be imported into a session
241241
where the `$PSEdition` automatic variable's value is included in the setting.
@@ -869,7 +869,7 @@ When you import the module, PowerShell runs the `Update-TypeData` cmdlet with
869869
the specified files. Because type files aren't scoped, they affect all session
870870
states in the session.
871871

872-
For more information on type files, see [about_Types.ps1xml][08]
872+
For more information on type files, see [about_Types.ps1xml][09]
873873

874874
For example, when you import this manifest, PowerShell loads the types
875875
specified in the `Example.ps1xml` file from the `Types` folder located in the
@@ -1386,20 +1386,20 @@ functions in the root module's scope.
13861386
| | Value |
13871387
| --------------------- | ------------------------------ |
13881388
| **Input Type** | `System.Collections.Hashtable` |
1389-
| **Required** | PowerShell Gallery |
1389+
| **Required** | PowerShell Gallery, Crescendo |
13901390
| **Value if unset** | `$null` |
13911391
| **Accepts wildcards** | No |
13921392

1393-
This setting has two primary effects:
1393+
When you export a Crescendo manifest to create a new module,
1394+
`Export-CrescendoModule` adds two keys to **PrivateData**
13941395

1395-
1. Any keys added to this setting are available to functions and cmdlets in the
1396-
root module with `$MyInvocation.MyCommand.Module.PrivateData`. The hash
1397-
table isn't available in the module scope itself, only in cmdlets you
1398-
define in the module.
1399-
1. You can add the **PSData** key with a hash table for metadata needed when
1400-
publishing to the PowerShell Gallery. For more information on module
1401-
manifests and the publishing to the PowerShell Gallery, see
1402-
[Package manifest values that impact the PowerShell Gallery UI][06]
1396+
- **CrescendoGenerated** - timestamp when the module was exported
1397+
- **CrescendoVersion** - the version of Crescendo used to export the module
1398+
1399+
You can add your own keys to hold metadata that you want to track. Any keys
1400+
added to this setting are available to functions and cmdlets in the root module
1401+
using `$MyInvocation.MyCommand.Module.PrivateData`. The hash table isn't
1402+
available in the module scope itself, only in cmdlets you define in the module.
14031403

14041404
For example, this manifest defines the **PublishedDate** key in
14051405
**PrivateData**.
@@ -1453,6 +1453,32 @@ This module will be stale in 16 days
14531453
WARNING: This module version was published more than 30 days ago.
14541454
```
14551455

1456+
#### PrivateData.PSData
1457+
1458+
The **PSData** child property defines a hash table of values that support
1459+
specific extension scenarios.
1460+
1461+
| | Value |
1462+
| --------------------- | ------------------------------------------------------------ |
1463+
| **Input Type** | `System.Collections.Hashtable` |
1464+
| **Required** | PowerShell Gallery, Experimental features, Crescendo modules |
1465+
| **Value if unset** | `$null` |
1466+
| **Accepts wildcards** | No |
1467+
1468+
The **PSData** child property is used for the following scenarios:
1469+
1470+
- PowerShell Gallery - When you create a module manifest using
1471+
`New-ModuleManifest` the cmdlet prepopulates the **PSData** hashtable with
1472+
place holder keys that are needed when publishing the module to the
1473+
PowerShell Gallery. For more information on module manifests and the
1474+
publishing to the PowerShell Gallery, see
1475+
[Package manifest values that impact the PowerShell Gallery UI][03].
1476+
- Crescendo modules - When you export a Crescendo manifest to create a new
1477+
module, `Export-CrescendoModule` adds the value `CrescendoBuilt` to the
1478+
**PSData.Tags** property. You can use this tag to find modules in the
1479+
PowerShell Gallery that were created using Crescendo. For more information,
1480+
see [Export-CrescendoModule][14].
1481+
14561482
### HelpInfoURI
14571483

14581484
This setting specifies the internet address of the HelpInfo XML file for the
@@ -1473,8 +1499,8 @@ in PowerShell 3.0. It contains information about the location of downloadable
14731499
help files for the module and the version numbers of the newest help files for
14741500
each supported locale.
14751501

1476-
For information about Updatable Help, see [about_Updatable_Help][09]. For
1477-
information about the HelpInfo XML file, see [Supporting Updatable Help][04].
1502+
For information about Updatable Help, see [about_Updatable_Help][10]. For
1503+
information about the HelpInfo XML file, see [Supporting Updatable Help][06].
14781504

14791505
For example, this module supports updatable help.
14801506

@@ -1514,22 +1540,24 @@ imported as `Get-ExampleItem`.
15141540

15151541
## See also
15161542

1517-
- [about_PowerShell_Editions][02]
1518-
- [New-ModuleManifest][11]
1519-
- [Test-ModuleManifest][12]
1520-
- [Modules with compatible PowerShell Editions][05]
1521-
- [Package manifest values that impact the PowerShell Gallery UI][06]
1522-
- [PowerShell module authoring considerations][03]
1543+
- [about_PowerShell_Editions][04]
1544+
- [New-ModuleManifest][12]
1545+
- [Test-ModuleManifest][13]
1546+
- [Modules with compatible PowerShell Editions][02]
1547+
- [Package manifest values that impact the PowerShell Gallery UI][03]
1548+
- [PowerShell module authoring considerations][05]
15231549

1524-
<!-- updated link references -->
1550+
<!-- link references -->
15251551
[01]: /powershell/dsc/overview
1526-
[02]: /powershell/module/microsoft.powershell.core/about/about_powershell_editions
1527-
[03]: /powershell/scripting/dev-cross-plat/performance/module-authoring-considerations
1528-
[04]: /powershell/scripting/developer/module/supporting-updatable-help
1529-
[05]: /powershell/gallery/concepts/module-psedition-support
1530-
[06]: /powershell/gallery/concepts/package-manifest-affecting-ui
1552+
[02]: /powershell/gallery/concepts/module-psedition-support
1553+
[03]: /powershell/gallery/concepts/package-manifest-affecting-ui
1554+
[04]: /powershell/module/microsoft.powershell.core/about/about_powershell_editions
1555+
[05]: /powershell/scripting/dev-cross-plat/performance/module-authoring-considerations
1556+
[06]: /powershell/scripting/developer/module/supporting-updatable-help
15311557
[07]: about_Format.ps1xml.md
1532-
[08]: about_Types.ps1xml.md
1533-
[09]: about_Updatable_Help.md
1534-
[11]: xref:Microsoft.PowerShell.Core.New-ModuleManifest
1535-
[12]: xref:Microsoft.PowerShell.Core.Test-ModuleManifest
1558+
[08]: about_Language_Modes.md
1559+
[09]: about_Types.ps1xml.md
1560+
[10]: about_Updatable_Help.md
1561+
[12]: xref:Microsoft.PowerShell.Core.New-ModuleManifest
1562+
[13]: xref:Microsoft.PowerShell.Core.Test-ModuleManifest
1563+
[14]: xref:Microsoft.PowerShell.Crescendo.Export-CrescendoModule

reference/7.2/Microsoft.PowerShell.Core/About/about_Module_Manifests.md

Lines changed: 68 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes the settings and practices for writing module manifest files.
33
Locale: en-US
4-
ms.date: 06/07/2023
4+
ms.date: 07/07/2023
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_module_manifests?view=powershell-7.2&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about Module Manifests
@@ -100,7 +100,7 @@ Allowed variables
100100
- `$EnabledExperimentalFeatures`
101101
- Any environment variables, like `$ENV:TEMP`
102102

103-
For more information, see [about_Language_Modes](about_Language_Modes.md).
103+
For more information, see [about_Language_Modes][08].
104104

105105
## Manifest settings
106106

@@ -158,7 +158,7 @@ By default, all module members in the **RootModule** are exported.
158158
> [!TIP]
159159
> Module loading speed differs between **Binary**, **Script**, and **CIM**
160160
> module types. For more information, see
161-
> [PowerShell module authoring considerations][03]
161+
> [PowerShell module authoring considerations][04]
162162
163163
For example, this module's **ModuleType** is **Manifest**. The only module
164164
members this module can export are those defined in the modules specified with
@@ -234,8 +234,8 @@ values.
234234

235235
For information about PSEdition, see:
236236

237-
- [about_PowerShell_Editions][02]
238-
- [Modules with compatible PowerShell Editions][05].
237+
- [about_PowerShell_Editions][09]
238+
- [Modules with compatible PowerShell Editions][02].
239239

240240
When this setting is defined, the module can only be imported into a session
241241
where the `$PSEdition` automatic variable's value is included in the setting.
@@ -869,7 +869,7 @@ When you import the module, PowerShell runs the `Update-TypeData` cmdlet with
869869
the specified files. Because type files aren't scoped, they affect all session
870870
states in the session.
871871

872-
For more information on type files, see [about_Types.ps1xml][08]
872+
For more information on type files, see [about_Types.ps1xml][10]
873873

874874
For example, when you import this manifest, PowerShell loads the types
875875
specified in the `Example.ps1xml` file from the `Types` folder located in the
@@ -1386,20 +1386,20 @@ functions in the root module's scope.
13861386
| | Value |
13871387
| --------------------- | ------------------------------ |
13881388
| **Input Type** | `System.Collections.Hashtable` |
1389-
| **Required** | PowerShell Gallery |
1389+
| **Required** | PowerShell Gallery, Crescendo |
13901390
| **Value if unset** | `$null` |
13911391
| **Accepts wildcards** | No |
13921392

1393-
This setting has two primary effects:
1393+
When you export a Crescendo manifest to create a new module,
1394+
`Export-CrescendoModule` adds two keys to **PrivateData**
13941395

1395-
1. Any keys added to this setting are available to functions and cmdlets in the
1396-
root module with `$MyInvocation.MyCommand.Module.PrivateData`. The hash
1397-
table isn't available in the module scope itself, only in cmdlets you
1398-
define in the module.
1399-
1. You can add the **PSData** key with a hash table for metadata needed when
1400-
publishing to the PowerShell Gallery. For more information on module
1401-
manifests and the publishing to the PowerShell Gallery, see
1402-
[Package manifest values that impact the PowerShell Gallery UI][06]
1396+
- **CrescendoGenerated** - timestamp when the module was exported
1397+
- **CrescendoVersion** - the version of Crescendo used to export the module
1398+
1399+
You can add your own keys to hold metadata that you want to track. Any keys
1400+
added to this setting are available to functions and cmdlets in the root module
1401+
using `$MyInvocation.MyCommand.Module.PrivateData`. The hash table isn't
1402+
available in the module scope itself, only in cmdlets you define in the module.
14031403

14041404
For example, this manifest defines the **PublishedDate** key in
14051405
**PrivateData**.
@@ -1453,6 +1453,37 @@ This module will be stale in 16 days
14531453
WARNING: This module version was published more than 30 days ago.
14541454
```
14551455

1456+
#### PrivateData.PSData
1457+
1458+
The **PSData** child property defines a hash table of values that support
1459+
specific extension scenarios.
1460+
1461+
| | Value |
1462+
| --------------------- | ------------------------------------------------------------ |
1463+
| **Input Type** | `System.Collections.Hashtable` |
1464+
| **Required** | PowerShell Gallery, Experimental features, Crescendo modules |
1465+
| **Value if unset** | `$null` |
1466+
| **Accepts wildcards** | No |
1467+
1468+
The **PSData** child property is used for the following scenarios:
1469+
1470+
- PowerShell Gallery - When you create a module manifest using
1471+
`New-ModuleManifest` the cmdlet prepopulates the **PSData** hashtable with
1472+
place holder keys that are needed when publishing the module to the
1473+
PowerShell Gallery. For more information on module manifests and the
1474+
publishing to the PowerShell Gallery, see
1475+
[Package manifest values that impact the PowerShell Gallery UI][03].
1476+
- Experimental features - Metadata about an experimental feature is kept in the
1477+
**ExperimentalFeatures** property of **PSData**. The **ExperimentalFeatures**
1478+
property is an array of hashtables containing the name and description of the
1479+
feature. For more information, see
1480+
[Declaring experimental features in modules][06].
1481+
- Crescendo modules - When you export a Crescendo manifest to create a new
1482+
module, `Export-CrescendoModule` adds the value `CrescendoBuilt` to the
1483+
**PSData.Tags** property. You can use this tag to find modules in the
1484+
PowerShell Gallery that were created using Crescendo. For more information,
1485+
see [Export-CrescendoModule][15].
1486+
14561487
### HelpInfoURI
14571488

14581489
This setting specifies the internet address of the HelpInfo XML file for the
@@ -1473,8 +1504,8 @@ in PowerShell 3.0. It contains information about the location of downloadable
14731504
help files for the module and the version numbers of the newest help files for
14741505
each supported locale.
14751506

1476-
For information about Updatable Help, see [about_Updatable_Help][09]. For
1477-
information about the HelpInfo XML file, see [Supporting Updatable Help][04].
1507+
For information about Updatable Help, see [about_Updatable_Help][11]. For
1508+
information about the HelpInfo XML file, see [Supporting Updatable Help][05].
14781509

14791510
For example, this module supports updatable help.
14801511

@@ -1514,22 +1545,25 @@ imported as `Get-ExampleItem`.
15141545

15151546
## See also
15161547

1517-
- [about_PowerShell_Editions][02]
1518-
- [New-ModuleManifest][11]
1519-
- [Test-ModuleManifest][12]
1520-
- [Modules with compatible PowerShell Editions][05]
1521-
- [Package manifest values that impact the PowerShell Gallery UI][06]
1522-
- [PowerShell module authoring considerations][03]
1548+
- [about_PowerShell_Editions][09]
1549+
- [New-ModuleManifest][13]
1550+
- [Test-ModuleManifest][14]
1551+
- [Modules with compatible PowerShell Editions][02]
1552+
- [Package manifest values that impact the PowerShell Gallery UI][03]
1553+
- [PowerShell module authoring considerations][04]
15231554

1524-
<!-- updated link references -->
1555+
<!-- link references -->
15251556
[01]: /powershell/dsc/overview
1526-
[02]: /powershell/module/microsoft.powershell.core/about/about_powershell_editions
1527-
[03]: /powershell/scripting/dev-cross-plat/performance/module-authoring-considerations
1528-
[04]: /powershell/scripting/developer/module/supporting-updatable-help
1529-
[05]: /powershell/gallery/concepts/module-psedition-support
1530-
[06]: /powershell/gallery/concepts/package-manifest-affecting-ui
1557+
[02]: /powershell/gallery/concepts/module-psedition-support
1558+
[03]: /powershell/gallery/concepts/package-manifest-affecting-ui
1559+
[04]: /powershell/scripting/dev-cross-plat/performance/module-authoring-considerations
1560+
[05]: /powershell/scripting/developer/module/supporting-updatable-help
1561+
[06]: about_experimental_features.md#declaring-experimental-features-in-modules-written-in-powershell
15311562
[07]: about_Format.ps1xml.md
1532-
[08]: about_Types.ps1xml.md
1533-
[09]: about_Updatable_Help.md
1534-
[11]: xref:Microsoft.PowerShell.Core.New-ModuleManifest
1535-
[12]: xref:Microsoft.PowerShell.Core.Test-ModuleManifest
1563+
[08]: about_Language_Modes.md
1564+
[09]: about_powershell_editions.md
1565+
[10]: about_Types.ps1xml.md
1566+
[11]: about_Updatable_Help.md
1567+
[13]: xref:Microsoft.PowerShell.Core.New-ModuleManifest
1568+
[14]: xref:Microsoft.PowerShell.Core.Test-ModuleManifest
1569+
[15]: xref:Microsoft.PowerShell.Crescendo.Export-CrescendoModule

0 commit comments

Comments
 (0)