如何将驱动器号映射到PowerShell中的本地路径?
在PowerShell中,是否可以将驱动器号映射到本地路径 例如,将如何将驱动器号映射到PowerShell中的本地路径?,powershell,Powershell,在PowerShell中,是否可以将驱动器号映射到本地路径 例如,将x:\映射到c:\myfolder1\myfolder2\可以使用: subst x:c:\myfolder1\myfolder2\ 或: New PSDrive-Name x-PSProvider FileSystem-Root c:\myfolder1\myfolder2\ 以下语句也将起作用(并且它仅使用本机powershell cmdlet): 我认为PSDrives只能在PowerShell会话中看到,而不能在外部程序
x:\
映射到c:\myfolder1\myfolder2\
可以使用:
subst x:c:\myfolder1\myfolder2\
或:
New PSDrive-Name x-PSProvider FileSystem-Root c:\myfolder1\myfolder2\
以下语句也将起作用(并且它仅使用本机powershell cmdlet):
我认为PSDrives只能在PowerShell会话中看到,而不能在外部程序中看到。@R0MANARMY-这一点很好。如果在PS会话中解决了任何问题,仍然值得展示如何使用。我还注意到同样的情况也适用于
subst
。
New-PsDrive -Name [DRIVELETTER] -PSProvider filesystem -Root "\\localhost\C$\[PATH]" -Persist