$psEditor.Workspace.OpenFile puts file name into all lower case.
See original GitHub issueSystem Details Output
### VSCode version: 1.49.0 e790b931385d72cf5669fcefc51cdf65990efa5d x64
### VSCode extensions:
andyyaldoo.vscode-json@1.5.0
jock.svg@1.3.9
ms-azure-devops.azure-pipelines@1.174.2
ms-azuretools.vscode-azurefunctions@0.24.0
ms-dotnettools.csharp@1.23.2
ms-mssql.mssql@1.9.0
ms-python.python@2020.8.108011
ms-vscode-remote.remote-containers@0.140.1
ms-vscode-remote.remote-ssh@0.51.0
ms-vscode-remote.remote-ssh-edit@0.51.0
ms-vscode-remote.remote-wsl@0.44.5
ms-vscode-remote.vscode-remote-extensionpack@0.20.0
ms-vscode.azure-account@0.9.3
ms-vscode.powershell@2020.6.0
ms-vscode.powershell-preview@2020.7.0
### PSES version: 2.3.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
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
This also appears with vs-code insiders and the 2020.9.0 extension …
The issue is that the $psEditor.Workspace.OpenFile - which is called from various places - like PsEdit, changes the file name to lower case. This is usually just a cosmetic problem, but I have found a case were pester ran a script using its lower-cased name and the script failed because it tried to do a case sensitive replace on part of its own name.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Changing the Case of a Filename - Perforce
How to change Perforce Helix lowercase file to a mixed case file. ... and you want to change the file name to use...
Read more >text editor - Vim save file in lower case - Stack Overflow
Since I cannot make a comment, I will make an answer instead. This same problem has been solved here: Vim overwrites filename when...
Read more >Vscode doesn't show change in opened file when ... - GitHub
I open the entire project on another texteditor and when I search the same file, it shows me just one match, the filename...
Read more >Is there a way to batch rename files to lowercase? - Super User
Go to the directory and run the following command: for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f"). Here is the...
Read more >Filename changes from upper case to lower case - MSDN
After the migration is completed, as I check the TFS files, I see that the file name cases are changed from upper to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rjmholt I think we store
ScriptFile
’s as all lower case in anOrderedDictionary
on Mac/Windows. I’ve ran into it too, easiest way to repro is:And then look at the tab title.
I think it only happens when you haven’t already opened the file at least once (so it’s not in the workspace cache). I’m guessing the path is always lowercase in the request and if VSCode hasn’t already cached some state for that file it’ll take our word for it.
It’s working with the module from https://github.com/MethodsAndPractices/vsteam and the author has a) A PS1 file for each command for each command function (e.g. Add-VSTeam.ps1) b) A .Tests.PS1 file for each (e.g. Add-VSTeam.Tests.ps1) as the unit test for that command. c) Lines in every unit-test to dot-source all the files needed for that command.
So I
Pester then runs add-vsteam.tests.ps1 and
$PSCommandPath).Replace(".Tests.", ".")
does not replace tests, because thisreplace()
is case sensitive. The script tires to DOT source a file with.tests
and everything fails.I know I could fix this by using
-replace
(or making other changes) but this bit of design isn’t under my control. I can work round it by not opening from the command line … and everywhere else - on windows at least - it is just a cosmetic thing. I don’t know what happens if the underlying OS has a case sensitive file system.