PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Add Scope to Repositories

Open SydneyhSmith opened this issue 3 years ago • 7 comments

Summary of the new feature / enhancement

In order to make repository registration available system-wide we should add a -Scope parameter to Register-PSRepository. This parameter will determine the file path where the repository metadata is stored and therefore determine whether all users can access the repository registration. This change will also introduce the following parameters:

  • [ ] Add a -Scope Parameter to Register-PSResourceRepository
  • [ ] Add a -Scope Parameter to Set-PSResourceRepository
  • [ ] Add a -Scope Parameter to Unregister-PSResourceRepository
  • [ ] Add a -Scope Parameter to Get-PSResourceRepository
  • [ ] Add a -RepositoryScope Parameter to Find-PSResource
  • [ ] Add a -RepositoryScope Parameter to Install-PSResource
  • [ ] Add a -RepositoryScope Parameter to Update-PSResource
  • [ ] Add a -RepositoryScope Parameter to Uninstall-PSResource
  • [ ] Add a -RepositoryScope Parameter to Publish-PSResource
  • [ ] Add a -RepositoryScope Parameter to Save-PSResource

Proposed technical implementation details (optional)

CurrentUser will remain the default behavior even with these changes. We will not enforce uniqueness across scope, and therefore need additional parameters to indicate repository scope.

SydneyhSmith avatar Mar 03 '22 19:03 SydneyhSmith

Be sure permissions for ubuntu are also taken into consideration with install scope parameter, related isse #364

StevenBucher98 avatar Mar 11 '22 19:03 StevenBucher98

Please review the "CurrentUser" default as more and more users have "Back up important PC folders to OneDrive" Enabled in OneDrive: https://github.com/PowerShell/PowerShellGet/issues/195, https://github.com/PowerShell/PowerShellGet/issues/724, https://github.com/PowerShell/PowerShellGet/issues/627

PS: The problem around this request has in two-weeks it's two-year anniversary on Nov 21, 2022!

weyCC81 avatar Nov 07 '22 21:11 weyCC81

@weyCC81 thanks for reaching out. There's an issue to track this in the PowerShell repository: https://github.com/PowerShell/PowerShell/issues/15552

It is being worked on and will be addressed from the PowerShell side.

anamnavi avatar Nov 14 '22 19:11 anamnavi

At the very least, allow for a -Path or -Destination parameter to Install-PSResource to override the -Scope parameter, and at best, allow for an environment variable, ps variable, powershell.config.json entry, or otherwise to opt in to a new default folder. This is work that can be done here while waiting on a PS result

JustinGrote avatar Nov 19 '22 00:11 JustinGrote

@JustinGrote We have Save-PSResource with the -IncludeXML parameter that would essentially give the desired outcome. The reason we didn't include -Path or -Destination parameter for Install-PSResource is because it would be redundant with Save-PSResource behavior.

anamnavi avatar Nov 21 '22 19:11 anamnavi