Skip to content

about_Data_Sections missing Variable parameter #648

@juneb

Description

@juneb

The syntax section of about_Data_Sections displays the following syntax diagram:

        DATA [-supportedCommand <cmdlet-name>] {
            <Permitted content>
        }

However, as shown in Microsoft.PowerShell.Operation.Validation.psm1, you can specify a name for the Data section. That name becomes a variable that holds the hashtable that ConvertFrom-StringData returns.

        DATA newVariable {
            ConvertFrom-StringData @'
                      Key=Value
            '@
        }

       PS C:\> $newVariable.Key
       Value

Please document this valid format and be sure to include the version of Windows PowerShell in which it became valid. Thanks!

Metadata

Metadata

Assignees

Labels

area-languageArea - PowerShell syntax and keywords

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions