如何PSDrive
在 Linux 上创建持久化?
PS /home/nicholas>
PS /home/nicholas> Get-PSDrive
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
/ 149.53 764.93 FileSystem / home/nicholas
Alias Alias
Env Environment
Function Function
Temp 149.53 764.93 FileSystem /tmp/
Variable Variable
PS /home/nicholas>
PS /home/nicholas> New-PSDrive
cmdlet New-PSDrive at command pipeline position 1
Supply values for the following parameters:
Name: foo
PSProvider: Filesystem
Root: /
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
foo 149.53 764.93 FileSystem /
PS /home/nicholas>
PS /home/nicholas> Get-PSDrive
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
/ 149.53 764.93 FileSystem / home/nicholas
Alias Alias
Env Environment
foo 149.53 764.93 FileSystem /
Function Function
Temp 149.53 764.93 FileSystem /tmp/
Variable Variable
PS /home/nicholas>
PS /home/nicholas> Remove-PSDrive
cmdlet Remove-PSDrive at command pipeline position 1
Supply values for the following parameters:
Name[0]: foo
Name[1]:
PS /home/nicholas>
PS /home/nicholas> Get-PSDrive
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
/ 149.53 764.93 FileSystem / home/nicholas
Alias Alias
Env Environment
Function Function
Temp 149.53 764.93 FileSystem /tmp/
Variable Variable
PS /home/nicholas>
PS /home/nicholas> New-PSDrive -Persist -Name covid -PSProvider FileSystem -Root /home/nicholas/ -Scope Global
New-PSDrive: A parameter cannot be found that matches parameter name 'Persist'.
PS /home/nicholas>
如上所述,创建一个临时驱动器显然可以正常工作。我希望如果可以创建这样的驱动器,那么创建一个新的持久驱动器应该可以正常工作。
也许我只是没有正确使用语法。