Why is Vim Opening a Blank File with My PSDrive?

0
0
Asked By TechWiz123 On

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

Answered By ShellMasterX On

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.

Scripter1 -

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

Answered By OldSchoolCoder On

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.

Answered By PowerPro99 On

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.

CodeNinja42 -

I'm mostly looking for a shortcut to avoid typing the full path to my file every time.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.