Update-Metadata

This function was introduced in version 0.1.0.

Updates the metadata nuspec file with the specified information.

Syntax

Update-Metadata `
    -key <String> `
    -value <String> `
    [-NuspecFile <String>]
Update-Metadata `
    -data <Hashtable> `
    [-NuspecFile <String>]

Description

When a key and value is specified, update the metadata element with the specified key and the corresponding value in the specified NuspecFile. Singlular metadata elements are the only ones changed at this time.

Notes

Will now show a warning if the specified key doesn't exist in the nuspec file. Will now show a warning when change for file/dependency key is greater than currently in the nuspec file. Will now show a warning when change has been omitted due to nodes not allowing change at that key. Will now show a warning when file/dependency doesn't have any attributes defined to be updated.

While the parameter NuspecFile accepts globbing patterns, it is expected to only match a single file.

Aliases

None

Examples

Example 1

Update-Metadata -key releaseNotes -value "https://github.com/majkinetor/AU/releases/latest"

Example 2

Update-Metadata -key releaseNotes -value "https://github.com/majkinetor/AU/releases/latest" -NuspecFile ".\package.nuspec"

Example 3

This is an example of changing the Title of the nuspec file

Update-Metadata -data @

  • or - @ | Update-Metadata

Example 4

This is an example of changing the id and version attributes for the dependency key

Update-Metadata -data @

  • or - @ | Update-Metadata

Example 5

This is an example of changing the src and target attributes

Update-Metadata -data @

  • or - @ | Update-Metadata

Example 6

This is an example of changing the file src and target attributes for the first file element in the nuspec file.

If only one file element is found the change value is omitted. @ | Update-Metadata

Inputs

None

Outputs

None

Required Parameters

-key <String>

The element that should be updated in the metadata section.

Property Value
Aliases
Position? named
Globbing? false
Default Value
Accept Pipeline Input? false

-value <String>

The value to update with.

Property Value
Aliases
Position? named
Globbing? false
Default Value
Accept Pipeline Input? false

-data <Hashtable>

Property Value
Aliases
Position? named
Globbing? false
Default Value @{$key = $value}
Accept Pipeline Input? true (ByValue)

Optional Parameters

-NuspecFile <String>

The metadata/nuspec file to update

Property Value
Aliases
Position? named
Globbing? true
Default Value .\*.nuspec
Accept Pipeline Input? false
GitHub