GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — Refactor the module path construction code to make it more robust and easier to maintain by daxian-dbw · Pull Request #26565 · PowerShell/PowerShell Conversation
|
| File | Description |
|---|---|
| test/powershell/Host/ConsoleHost.Tests.ps1 | Added test for PSModulePath with multiple paths from config file; contains platform-specific path separator issues |
| src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs | Refactored module path construction: moved initialization to static constructor, consolidated UpdatePath logic, improved PathContainsSubstring with better return semantics |
| src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs | Enhanced exception reporting to include stack traces for debugging ShellCannotBeStarted errors; contains potential null reference issues |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
On top of ModuleIntrinsics.cs I see we define Tracer. It would be nice to add to the trace source and result path strings for more easy diagnostics.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| // Local function to normalize a path by removing trailing directory separators. | ||
| static string NormalizePath(string path) | ||
| { | ||
| string normalizedPath = path.TrimEnd(Path.DirectorySeparatorChar); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why not use NormalizePath method from FileSystemProvider? Then we will follow the basic PowerShell behavior regarding directory separators.
Otherwise, we could use Path.TrimEndingDirectorySeparator()
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Path.TrimEndingDirectorySeparator doesn't remove duplicate trailing directory separators. It only removes the ending one. But I think it should be practically fine, and also, I favor over simplicity. We can get back to it if it turns out to be an issue.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ready to merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Thanks for the review! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… easier to maintain (PowerShell#26565)
… easier to maintain (PowerShell#26565)
… easier to maintain (PowerShell#26565)
- Note that PowerShell/PowerShell#26565 fixed the crash in 7.7 and that the patch can be dropped with 7.7 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Error when starting powershell 7.4, 7.5 or 7.6; "Index was out of range. Must be non-negative and less than or equal to the size of the collection. (Parameter “startIndex”)"
There was an error while loading. Please reload this page.