Reputation: 8967
In PowerShell, is it possible to map a drive letter to a local path ?
So for example map x:\
to c:\myfolder1\myfolder2\
Upvotes: 7
Views: 7524
Reputation: 41
The following statement will also work (and it only uses native powershell cmdlets):
New-PsDrive -Name [DRIVELETTER] -PSProvider filesystem -Root "\\localhost\C$\[PATH]" -Persist
Upvotes: 4
Reputation: 119806
You could use subst
:
subst x: c:\myfolder1\myfolder2\
or New-PSDrive
:
New-PSDrive -Name x -PSProvider FileSystem -Root c:\myfolder1\myfolder2\
Upvotes: 9