Skip to content

Add Scope to Repositories #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
10 tasks
SydneyhSmith opened this issue Mar 3, 2022 · 7 comments
Open
10 tasks

Add Scope to Repositories #616

SydneyhSmith opened this issue Mar 3, 2022 · 7 comments

Comments

@SydneyhSmith
Copy link
Collaborator

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.

@StevenBucher98
Copy link
Collaborator

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

@weyCC81
Copy link

weyCC81 commented Nov 7, 2022

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!

@anamnavi
Copy link
Member

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

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

@JustinGrote
Copy link
Contributor

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

@anamnavi
Copy link
Member

@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.

@alerickson alerickson modified the milestones: 3.0-Approved, vNext Jan 18, 2023
@kilasuit
Copy link

@SydneyhSmith this was asked about in the PSConfEU Mini Con chat today and would be great to get into a v1.1 if possible

@vandre
Copy link

vandre commented Nov 20, 2023

+1 For this. As it is right-now it is impossible to upgrade a package that was installed with a private repository using Install-PsResource -Scope AllUsers

# Import Module works as expected (Module installed -Scope AllUsers)
import-module mymodule

# throws error Update-PSResource: No installed packages were found with name 'mymodule' in scope 'CurrentUser'.
Update-PsResource mymodule

# throws error Update-PSResource: Package 'mymodule' could not be found in any registered repositories.
Update-PSResource mymodule  -Scope AllUsers

Edit: I just realized that this is the same as #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants