Skip to content

Add a Current Process Path Automatic Variable #26950

@kilasuit

Description

@kilasuit

Summary of the new feature / enhancement

As a user or admin I want to know much easier than it is today what path the process I am running in is.

I don't think this is too big a task to implement & would be useful for defensive & diagnostic purposes, especially for users that are new to PowerShell.

I am initially self assigning this issue as I don't think it should take long to have a suitable PR for this.

Proposed technical implementation details (optional)

Automatic Variable of either $pp or $PSProcessPath that outputs the path of the current pwsh process from [environment]::ProcessPath which isn't available in .NET Framework (so unavailable in Windows PowerShell)

Alternative Approach - a new Automatic $PSProcess Variable that essentially runs $PSProcess = Get-Process -id $PID so that you can get all details about the current PowerShell Process

Notes

Other alternative approaches outside of adding this in directly to PowerShell & were evaluated prior to raising this issue & the attached PR

Metadata

Metadata

Assignees

Labels

Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Enginecore PowerShell engine, interpreter, and runtimeWG-NeedsReviewNeeds a review by the labeled Working Group

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions