Add automatic variable for current process path#26991
Open
kilasuit wants to merge 2 commits intoPowerShell:masterfrom
Open
Add automatic variable for current process path#26991kilasuit wants to merge 2 commits intoPowerShell:masterfrom
kilasuit wants to merge 2 commits intoPowerShell:masterfrom
Conversation
…path Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new fixed/automatic variable ($pp) intended to expose the full path of the current process executable (using Environment.ProcessPath) and adds coverage to validate its behavior.
Changes:
- Add
$ppto the engine’s fixed variables initialization and to the AllScope variable type map. - Add a localized description string for the new variable.
- Add Pester tests validating
$ppvalue/immutability.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 | Adds Pester coverage for $pp behavior (type, const-ness, value). |
| src/System.Management.Automation/resources/RunspaceInit.resx | Adds description text for $pp (shown via variable metadata). |
| src/System.Management.Automation/engine/SpecialVariables.cs | Registers pp as a known AllScope variable/type. |
| src/System.Management.Automation/engine/SessionState.cs | Initializes $pp as a Constant/AllScope fixed variable using Environment.ProcessPath. |
9f8194f to
a7ad113
Compare
2 tasks
Contributor
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Add's Automatic Vairiable for Current Process Path
$PSProcessPathfixes #26950
PR Context
Removes need to use .NET method for this mimicing current
$PIDautomatic variablePR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header