Get-PSModulePath: Fails with unclear exception when user is SYSTEM and Scope
is CurrentUser
#122
Labels
bug
The issue is a bug.
good first issue
The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
Problem description
When the command
Get-PSModulePath
is called as the user SYSTEM with the parameterScope
set toCurrentUser
then if fails with an unclear exception.Verbose logs
How to reproduce
Run the command
Get-PSModulePath -Scope CurrentUser
as SYSTEM.Expected behavior
Should return an error message that is more clear what is going on.
Current behavior
Fails with an unclear message.
Suggested solution
Should throw a clear message saying that the path retrieved was
$null
and possible output the current user in the error message ($env:USERNAME
on WIndows and$env:USER
on Linux and macOS). 🤔Operating system the target node is running
PowerShell version and build the target node is running
Module version used
The text was updated successfully, but these errors were encountered: