PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

[Feature Request] Session scope for Register-PSRepository

Open f0rt opened this issue 8 years ago • 4 comments

Team, Can you please add session scope support for Register-PSRepository?

We have an internal build system that outputs PowerShell modules. Every successful build is published to an internal PSRepository (Artifactory server). Every time we want to publish a module we have to deal with the following cases:

  • Is the repository already registered?
  • Is another repository with different name and the same SourceLocation already registered?
  • If the repository is already registered and we want to deploy on different url (PublishLocation) we have to modify the existing registration
  • Clean the build machine after build procedure (Unregister-PSRepository)
  • If 2 parallel builds are running on the same build machine at the same time this can cause conflicts (dealing with the same shared resource)

The problems described above can be avoided with Register-PSRepository operating on session level. Let me know if you have any questions.

Thanks, Nedko

f0rt avatar Mar 15 '17 22:03 f0rt

It would be also great if there was a scope option to register PSRepository on a system-wide level

Glober777 avatar Dec 26 '17 08:12 Glober777

Does being able to install to a specific location solve this scenario?

SydneyhSmith avatar Aug 01 '23 21:08 SydneyhSmith

Thanks @HeyItsGilbert that use case makes sense to me for a system wide registration, I am wondering if the use case for a session scope registration is covered?

SydneyhSmith avatar Aug 01 '23 22:08 SydneyhSmith

Sorry, I deleted my comment because I re-read the original request and realized that this request was specifically for a per Session scope.

If Publish Module allowed you alternatively specify a repo like data structure that might solve @f0rt's issue. Publish-Module Foo -Repo @{'Name' = 'My Repo'; 'Url' = 'myurl.com' }. No need to confirm of anything pre-existing and no clean up after the fact.

HeyItsGilbert avatar Aug 01 '23 22:08 HeyItsGilbert