I recently created a new PowerShell Drive (PSDrive) named `S:` using the command `new-psdrive -name S -psprovider filesystem -root c:\users\username\dir`. While I can successfully read a file using `get-content S:\test.txt`, I'm running into issues when trying to open the same file with Vim. It just opens a blank document instead. Any ideas on what might be going wrong?
3 Answers
You could also try using the `-Persist` or `-Scope` options when creating the PSDrive, but keep in mind you might get errors if you try to use `-Persist` for a local location. I had no luck with `-Scope global` either in similar situations.
If you're looking for a simpler solution, consider using the `subst` command. It’s a bit retro, but it allows you to map a drive letter to a folder without involving SMB.
It sounds like you're running into a limitation with PSDrive. Since PSDrive is a PowerShell construct, traditional applications like Vim cannot access it properly. You might want to consider using `new-smbmapping` instead if you need it to work with more applications.
I'm mostly looking for a shortcut to avoid typing the full path to my file every time.

I found that `-Persist` doesn't work for local paths, and `-Scope` didn't resolve it for me either.