Amadevus / pwsh-script

GitHub Action to run PowerShell scripts in a rich, prepared scope - inspired by actions/github-script.
MIT License
47 stars 8 forks source link

Error: ConvertTo-Json : An item with the same key has already been added. Key: Version #10

Closed sergey-s-betke closed 3 years ago

sergey-s-betke commented 3 years ago

Please, help me with pwsh-script action:

https://github.com/test-st-petersburg/DocTemplates/runs/2487220589?check_suite_focus=true#step:4:70

Code: https://github.com/Amadevus/pwsh-script/blob/f7555022ec3bd8befa08e58817566a5f9444c8ef/lib/GitHubActionsCore/GitHubActionsCore.psm1#L654-L678

sergey-s-betke commented 3 years ago

After any call to Install-Package -ProviderName NuGet ... i have there error. With -verbose and without -verbose. What is it?

sergey-s-betke commented 3 years ago

Error source:

Register-PackageSource -Name 'nuget.org' -Location 'https://api.nuget.org/v3/index.json' -ProviderName NuGet -Trusted -Force -Verbose;

Workaround:

Register-PackageSource -Name 'nuget.org' -Location 'https://api.nuget.org/v3/index.json' -ProviderName NuGet -Trusted -Force -Verbose | Out-Null;