Skip to content
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

Setting "powershell.codeFormatting.useCorrectCasing" is removing ".\" paths #2725

Closed
dprice opened this issue May 20, 2020 · 2 comments
Closed
Labels
Resolution-Duplicate Will close automatically.

Comments

@dprice
Copy link

dprice commented May 20, 2020

Steps to reproduce

In either VSCode v1.45.1 or VSCode Insiders v1.46.0-insider, when powershell.codeFormatting.useCorrectCasing is set to true, any scripts that call another PowerShell script file like this:

& .\Test-Junk.ps1

will get automatically formatted like this:

& Test-Junk.ps1

which breaks the script. See attached gif showing the issue. It may be difficult to see, but I also have the format on save.

PowerShell_Format_Path_Issue

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      7.0.1
PSEdition                      Core 
GitCommitId                    7.0.1
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.18.0
1.18.3
@SydneyhSmith SydneyhSmith transferred this issue from PowerShell/PSScriptAnalyzer May 26, 2020
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 26, 2020
@SydneyhSmith
Copy link
Collaborator

@dprice thanks for opening this issue...upon investigation it looks like this bug is fixed in the latest version of PSSA but VSCode is not pulling in this version thus you see the bug, therefore this looks like a duplicate of #2697

@SydneyhSmith SydneyhSmith added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels May 26, 2020
@ghost
Copy link

ghost commented May 27, 2020

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

@ghost ghost closed this as completed May 27, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants