Skip to content

Different Handling of $PSScriptRoot for Debugging #4085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
MrFly72 opened this issue Jul 19, 2022 · 3 comments
Closed
2 tasks done

Different Handling of $PSScriptRoot for Debugging #4085

MrFly72 opened this issue Jul 19, 2022 · 3 comments
Labels
Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically.

Comments

@MrFly72
Copy link

MrFly72 commented Jul 19, 2022

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

Today $PSScriptRoot is only a Non-Null-Value when the script is started by "F5".
If you use only parts or even one line, $PSScriptRoot is $Null.

Proposed Design

It would be cool, if the VSCode Powershell Extension would handle the $PSScriptRoot Variable a little different:

  1. When running normally, it is working good (F5-Mode) --> $PSScriptRoot is filled with the correct path
  2. If the user runs part of a code, there has to be a decision made:
  • If the part of the code comes from a editor-window which has already been saved, --> Take the path of the file (like F5 would do) into $PSScriptRoot
  • If the editor-window has not been saved --> Take the current path inside of $PSScriptRoot.

This would I believe help tons of developers while debugging code, as I know a lot of them copying lines of code, replace $PSScriptRoot temporarily (and afterwards forget about that) etc.

@MrFly72 MrFly72 added the Issue-Enhancement A feature request (enhancement). label Jul 19, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jul 19, 2022
@SeeminglyScience
Copy link
Collaborator

SeeminglyScience commented Jul 19, 2022

Duplicate of #633

@SeeminglyScience SeeminglyScience added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Jul 19, 2022
@SeeminglyScience SeeminglyScience marked this as a duplicate of #633 Jul 19, 2022
@SeeminglyScience
Copy link
Collaborator

SeeminglyScience commented Jul 19, 2022

Thanks for the suggestion! Tracking in the issue marked above

@ghost
Copy link

ghost commented Jul 20, 2022

This issue has been marked as duplicate and has not had any activity in a day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Jul 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants