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

PSResourceGet exports the $PSGetPath variable but never sets the value #1625

Open
3 tasks done
sdwheeler opened this issue Apr 5, 2024 · 1 comment
Open
3 tasks done
Labels
Area-Paths Issue-Bug Something isn't working

Comments

@sdwheeler
Copy link
Contributor

sdwheeler commented Apr 5, 2024

Prerequisites

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

Steps to reproduce

In a new session import PSResourceGet but don't import PowerShellGet v2. Examine the value of $PSGetPath.

Expected behavior

PS> Get-Variable PSGetPath -ValueOnly

AllUsersModules    : C:\Program Files\PowerShell\Modules
AllUsersScripts    : C:\Program Files\PowerShell\Scripts
CurrentUserModules : C:\Users\sewhee\Documents\PowerShell\Modules
CurrentUserScripts : C:\Users\sewhee\Documents\PowerShell\Scripts

Actual behavior

PS> Get-Variable PSGetPath -ValueOnly
Get-Variable: Cannot find a variable with the name 'PSGetPath'.

Error details

No error.

The variable $PSGetPath was added to PowerShellGet v2 in PowerShell/PowerShellGetv2#486. The variable is never used by the modules, it is provided to give users information about the location of the Modules and Scripts folder for each scope.

PSResourceGet exports the variable in the module manifest, but nowhere in code does it set the value.

Environment data

PS> gmo -list Microsoft.PowerShell.PSResourceGet

    Directory: C:\Users\sewhee\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     1.0.2                 Microsoft.PowerShell.PSResourceGet  Core,Desk {Find-PSResource, Get-InstalledPSResour…
Binary     1.0.0                 Microsoft.PowerShell.PSResourceGet  Core,Desk {Find-PSResource, Get-InstalledPSResour

Visuals

No response

@SydneyhSmith SydneyhSmith added Issue-Bug Something isn't working Area-Paths and removed Needs-Triage labels Apr 5, 2024
@LaurentDardenne
Copy link

it seems that there is no documentation of this variable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Paths Issue-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants