Skip to content
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

Bug with Get-InstalledScript and Uninstall-Script #64

Open
3 tasks done
alerickson opened this issue Feb 9, 2024 · 1 comment
Open
3 tasks done

Bug with Get-InstalledScript and Uninstall-Script #64

alerickson opened this issue Feb 9, 2024 · 1 comment

Comments

@alerickson
Copy link
Member

alerickson commented Feb 9, 2024

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Install-Script -Name Install-VSCode -Repository PSGallery -NoPathUpdate -Scope AllUsers -verbose -debug

will install at AllUsers scope (as expected).

Expected behavior

Get-InstalledScript Install-VSCode
should be able to find the script installed. PowerShellGet 2.2.5 functionality checks AllUsers first and if it's not there, checks CurrentUser scope.

Actual behavior

Get-InstalledScript
does not have a -Scope parameter so it does not pass a -Scope parameter onto Get-InstalledPSResource. Get-InstalledPSResource just uses the default value of CurrentUser and never checks AllUsers.

Note: This is also happening with Get-InstalledModule, Uninstall-Script, and Uninstall-Module.

One proposal is to have PSResourceGet's ScopeType be a flagged enum so that multiple values can be passed (this would be a breaking change in PSResourceGet).

Version

3.0.23-beta23

@SydneyhSmith
Copy link
Collaborator

The plan is to adapt PSResourceGet so that it checks first currentuser scope and then alluser scope by default

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

No branches or pull requests

2 participants