You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
When running normally, it is working good (F5-Mode) --> $PSScriptRoot is filled with the correct path
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.
The text was updated successfully, but these errors were encountered:
Prerequisites
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:
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.
The text was updated successfully, but these errors were encountered: