PowerShell / PowerShell/PowerShell
-NoProfile should not add Modules folder under the user profile in PSModulePath
Open
Nobody has claimed this yet.
Needs-Triage
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 88
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- Start cmd
- Clear the environment variable PSModulePath
- Start pwsh.exe -noprofile
- Evaluate $env:PSModulePath
Expected behavior
PSModulePath should not include any path under the user profile.
Actual behavior
PSModulePath includes paths under the user profile.
Error details
N/A
Environment data
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.26236
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the listed cmd and pwsh.exe -noprofile steps after clearing PSModulePath, then inspect how PSModulePath is initialized. Done means the resulting value contains no path under the user profile when -noprofile is used, while preserving the reported environment context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100