JustinGrote / JustinGrote/ModulePath

Get-ModulePath -AllUsers returns wrong folder path

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
PowerShell
Stars
25
Forks
0
PR merge metrics
No merged PRs in 30d

Description

When running `Get-ModulePath` with _-AllUsers_ parameter, the returned folder refers to modules that are included with PowerShell, not AllUsers path.

The problem is in https://github.com/JustinGrote/ModulePath/blob/main/ModulePath.psm1#L103, where GetPSModulePath method uses wrong scope reference. The reference should be **Machine** instead of **BuiltIn**.

The problem only surfaces, when there is no custom path in .config.json file.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.