PowerShell / PSResourceGet

PSResourceGet is the package manager for PowerShell
https://www.powershellgallery.com/packages/Microsoft.PowerShell.PSResourceGet
MIT License
484 stars 92 forks source link

Publish-PSResource doen't add tags when publishing script to local repository #1239

Closed peetrike closed 1 year ago

peetrike commented 1 year ago

Prerequisites

Steps to reproduce

When publishing script to local repository, the .nuspec file inside package contains tags element as following:

<tags>PSScript System.String[]</tags>

Expected behavior

PS ❯ find-script -name te* -repository test | select name, tags

Name       Tags
----       ----
testscript {PSScript, tag1, tag2, tag3}

Actual behavior

PS ❯ find-script -name te* -repository katse | select name, tags

Name       Tags
----       ----
testscript {PSScript, System.String[]}

Error details

no error

Environment data

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     0.5.22     Microsoft.PowerShell.PSResourceGet

Name                           Value
----                           -----
PSVersion                      7.3.5
PSEdition                      Core
GitCommitId                    7.3.5
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

peetrike commented 1 year ago

it seems, that this issue is caused by comma as separator in script metadata fields Tags and/or ExternalModuleDependencies. After removing commas, tags were published correctly (but tag PSScript was no more added).

peetrike commented 1 year ago

hm, same effect occurred when script file did not have metadata field Tags

peetrike commented 1 year ago

the same effect occurs, when there is Tags field but no required modules are found from script. Like, for example, in #1248