Full executable paths are stripped on format
See original GitHub issueSystem Details
System Details Output
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Codium version
> codium -v
1.37.0
036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
x64
Extension version
> codium --list-extensions --show-versions
...
ms-vscode.powershell@2019.5.0
Editor Services version
> $psEditor.EditorServicesVersion
Major Minor Build Revision
----- ----- ----- --------
1 12 1 0
Issue Description
This extension is changing lines for me which I do not think should be changed. And the criteria doesn’t make sense. If the full path used exists on the file system, then the path is stripped down to the last element.
Expected Behaviour
Full path to an executable is used in a PowerShell script, and the formatter leaves it be.
Actual Behaviour
Full path to an executable is used in a PowerShell script, and the formatter cuts it down to the last element.
Attached Logs
Postscript
I think that having an option to disable this functionality would be good. I could not find the rule associated with this formatting in PSScriptAnalyzer.
Along with this, when enabled, full executable paths should always be stripped, not just those whose paths exist on the system.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
Ok great - I’ll close this issue since it was related to PSScriptAnalyzer and is fixed in 1.18.1. We should be doing a release of the vscode extension in the next couple weeks which will include a new PSSA.
Yes, I installed 1.18.1 to fix it.