PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Install-PSResource erroneously reports my scripts are not in the PATH

Open Jaykul opened this issue 2 years ago • 1 comments

Prerequisites

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

Steps to reproduce

When I run Install-PSResource Install-RequiredModule it warns me:

WARNING: The installation path for the script does not currently appear in the CurrentUser path environment variable. To make the script discoverable, add the script installation path, F:\Users\Jaykul\OneDrive - PoshCode\Documents\PowerShell\Scripts, to the environment PATH variable.

But that path is in my PATH variable.

image

Expected behavior

It should just install the script.

Actual behavior

It slanders my PATH, and makes me double-check my work 😜

Error details

Install-PSResource Install-RequiredModule

Environment data

> $(Get-Module Microsoft.PowerShell.PSResourceGet | Out-String; $PSVersionTable | Format-Table | Out-String ) | Set-Clipboard

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.0.0                 Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-…



Name                           Value
----                           -----
PSVersion                      7.4.0-preview.6
PSEdition                      Core
GitCommitId                    7.4.0-preview.6
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Jaykul avatar Oct 27 '23 06:10 Jaykul

Thanks @Jaykul this one was really bugging us too 😄

SydneyhSmith avatar Oct 30 '23 18:10 SydneyhSmith