sagmor / ADOPowershellGet

Install Powershell Modules from Azure Devops Nuget Feeds
https://powershellgallery.com/packages/ADOPowerShellGet
MIT License
0 stars 1 forks source link

Install-ADOPSModule doesn't have project-scoped feed support. Created PR #7 to address this. #8

Open jteves opened 2 years ago

jteves commented 2 years ago

Hi @sagmor , / Hope all is well with you. Some of our build pipeline requires using project-scoped feeds when installing ADO based PS modules. We ran the function as such:

Install-ADOPSModule <Organization>/<Feed> <Package> ...

but the pipeline spit out the following error:

Register-PSRepository : The specified Uri 'https://pkgs.dev.azure.com/<Organization>/_packaging/<Feed>/nuget/v2/' for parameter 'SourceLocation' is an invalid Web Uri. Please ensure that it meets the Web Uri requirements.
At C:\Program Files\WindowsPowerShell\Modules\ADOPowershellGet\0.2.4\Functions\Public\Install-ADOPSModule.ps1:81 char:9

We determined that this feed url wasn't valid:

https://pkgs.dev.azure.com/<Organization>/_packaging/<Feed>/nuget/v2/

but this was:

"https://pkgs.dev.azure.com/<Organization>/<Project>/_packaging/<Feed>/nuget/v2/"

because the feed was project-scoped and needed the <Project> in the feed url. I ended up adding support for project-scoped feeds in PR #7 . The PR allows for including the project in the feed parameter, in order to allow project-scoped feed support.

Examples:


Install-ADOPSModule <Organization>/<Feed> <Package> ...
Install-ADOPSModule <Organization>/<Project>/<Feed> <Package> ...

Whenever you get the chance, do you mind reviewing and approving?

Thanks, Jacob