Skip to content

Wrap $PSProcessPath automatic variable in PSProcessPathAutomaticVariable experimental feature#167

Draft
Copilot wants to merge 3 commits intocopilot/add-automatic-variable-current-process-pathfrom
copilot/wrap-automatic-variable-psprocesspath
Draft

Wrap $PSProcessPath automatic variable in PSProcessPathAutomaticVariable experimental feature#167
Copilot wants to merge 3 commits intocopilot/add-automatic-variable-current-process-pathfrom
copilot/wrap-automatic-variable-psprocesspath

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 12, 2026

$PSProcessPath was unconditionally registered as an automatic variable in every session. This wraps it behind the PSProcessPathAutomaticVariable engine experimental feature so it can be opted into rather than always present.

Changes

  • ExperimentalFeature.cs: Added PSProcessPathAutomaticVariable constant and corresponding EngineExperimentalFeatures entry
  • SessionState.cs: Gated $PSProcessPath variable registration behind ExperimentalFeature.IsEnabled(ExperimentalFeature.PSProcessPathAutomaticVariable)
  • AutomaticVariables.Tests.ps1: Updated existing tests to skip via Set-ItResult -Skipped when the feature is disabled; added a complementary "feature disabled" describe block that asserts the variable is absent

Behavior

# Feature disabled (default) — variable not registered
Get-Variable PSProcessPath   # throws

# Feature enabled
Enable-ExperimentalFeature PSProcessPathAutomaticVariable
# restart session
$PSProcessPath   # /usr/bin/pwsh (constant, AllScope)
Original prompt

This section details on the original issue you should resolve

<issue_title>Wrap</issue_title>
<issue_description>### Summary of the new feature / enhancement

Wrap the Automatic Variable for PSProcessPath in an experimental feature

Proposed technical implementation details (optional)

Wrap the changes in branch copilot/add-automatic-variable-current-process-path in an experimental feature</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…eature

Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
Copilot AI changed the title [WIP] Wrap the Automatic Variable for PSProcessPath in experimental feature Wrap $PSProcessPath automatic variable in PSProcessPath experimental feature Mar 13, 2026
Copilot AI requested a review from kilasuit March 13, 2026 00:01
@kilasuit
Copy link
Copy Markdown
Owner

@copilot can we rename the Experimental Feature to PSProcessPathAutomaticVariable

…ticVariable

Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Mar 13, 2026

@copilot can we rename the Experimental Feature to PSProcessPathAutomaticVariable

Done — renamed to PSProcessPathAutomaticVariable across ExperimentalFeature.cs, SessionState.cs, and the test file in commit 066928f.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.powershellgallery.com
    • Triggering command: /home/REDACTED/.dotnet/dotnet /home/REDACTED/.dotnet/dotnet restore /home/REDACTED/work/PowerShell/PowerShell/src/Modules --runtime linux-x64 /property:SDKToUse=Microsoft.NET.Sdk --verbosity quiet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Wrap $PSProcessPath automatic variable in PSProcessPath experimental feature Wrap $PSProcessPath automatic variable in PSProcessPathAutomaticVariable experimental feature Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants