Plus in String get's removed
See original GitHub issueSystem Details
System Details Output
VSCode version: 1.50.1 d2e414d9e4239a252d1ab117bd7067f125afd80a x64
VSCode extensions:
donjayamanne.githistory@0.6.12 eamodio.gitlens@10.2.2 ecmel.vscode-html-css@0.2.3 formulahendry.terminal@0.0.10 huizhou.githd@2.2.4 justin-grote.better-powershell-syntax-highlighting@0.0.2 MamoruDS.workspace-cacheclean@0.0.2 ms-mssql.mssql@1.9.0 ms-vscode-remote.remote-wsl@0.50.1 ms-vscode.powershell@2020.6.0 streetsidesoftware.code-spell-checker@1.9.2 streetsidesoftware.code-spell-checker-hebrew@0.1.4 techer.open-in-browser@2.0.0 Tyriar.shell-launcher@0.4.1 Tyriar.terminal-tabs@0.2.0 vscode-icons-team.vscode-icons@11.0.0 Zignd.html-css-class-completion@1.19.0
PSES version: 2.2.0.0
PowerShell version:
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Description
I have a module where i pass a string parameter like this: -Message (“We retrieved " + $comps.count + " computers from AD”) }
What VS Code does when auto-formatting is change the sentence to: -Message (“We retrieved " $comps.count + " computers from AD”)
Note the first plus in the sentence was removed.
In the problems window I get this:
But the code runs just fine.
And I can’t even run the code without saving, since it’s changes the code and then messes everything up.
Expected Behaviour
This code worked fine in previous versions of VSCode. Something changed, although not sure what.
Actual Behaviour
– Description of what actually happens –
Attached Logs
Follow the instructions in the troubleshooting docs about capturing and sending logs.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
I updated but I still got the message in PowerShell 7 using a regular shell, outside of VSCode.
Great to hear that. The PowerShell extension ships a backup of the PSSA module in case the user does not have it installed. Right now the stable extension still ships 1.19.0 unfortunately as it hasn’t released an update for a while but the preview extension already ships 1.19.1. Therefore by installing the latest version, you’ve fixed the issue. You can always periodically run the install command but otherwise you are at the mercy of the PowerShell extension updating the pssa module in time. Some of this is by design to limit the blast radius in case a serious bug got found in a new pssa release. Cc @SydneyhSmith