Skip to content

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

Open
@sdwheeler

Description

@sdwheeler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions