Prerequisites
Summary
I can not see this as an issue and I think it is the extension but it may be VS code itself (if so I'll close this and and open there).
I'm working with some scripts which generate other PowerShell scripts, so the process goes
- Edit generator or Edit instructions in VSCode
- Run the generator script from the PowerShell integrated console
- Edit the resulting code
What I'm finding is the error highlighting is marking thing in the text as errors which were in a previous version. What seems to cause this is the change made to the file outside VS code, as if there is a copy cached, which is still used when the updated file is opened.
PowerShell Version
Name Value�[0m
---- -----�[0m
PSVersion 7.2.4
PSEdition Core
GitCommitId 7.2.4
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visual Studio Code Version
1.67.2
c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
x64
Extension Version
ms-vscode.powershell@2022.5.1
Steps to Reproduce
- Add extra lines containing a syntax error to an otherwise valid file. Problems should be displayed correctly
- Close it, and edit it outside VS Code to remove the error
- Reopen in VSCode and note the problems show before are still show. (see Visuals below)
Visuals

Logs
No response
Prerequisites
Summary
I can not see this as an issue and I think it is the extension but it may be VS code itself (if so I'll close this and and open there).
I'm working with some scripts which generate other PowerShell scripts, so the process goes
What I'm finding is the error highlighting is marking thing in the text as errors which were in a previous version. What seems to cause this is the change made to the file outside VS code, as if there is a copy cached, which is still used when the updated file is opened.
PowerShell Version
Visual Studio Code Version
Extension Version
ms-vscode.powershell@2022.5.1Steps to Reproduce
Visuals
Logs
No response