New-PSDrive: A parameter cannot be found that matches parameter name 'Persist'

1.3k views Asked by At

How do I create a persistent PSDrive on 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> 

Creating an ephemeral drive, as above, clearly works fine. I'd expect that if such a drive can be created, then creating a new persistent drive should work fine.

Perhaps I'm simply not using the syntax correctly.

0

There are 0 answers