Reputation: 8951
I'm trying to create a D: drive in Windows, which points to some local directory (e.g. C:\DDrive) using PowerShell.
This code runs fine:
New-PSDrive -Name D -Root "C:\D_Drive\" -PSProvider "FileSystem"
But in the Windows Explorer no D:-drive is visible.
How does one use that command correctly? Also: the drive should be permanent, so I tried adding a "-Persist" parameter. But that leads to an error ("unknown parameter "-Persist"...").
Upvotes: 1
Views: 2731
Reputation: 111
Just run:
subst D: "C:\D_Drive\"
in non-elevated PS session (don't run as Administrator).
Upvotes: 1
Reputation: 2415
The New-PSDrive command only creates a mapping that is visible in PowerShell. It's not shown in explorer at all.
Here are two other questions that ask the same thing:
https://community.spiceworks.com/topic/649234-powershell-mapped-drive-not-showing-in-my-computer
Upvotes: 0