NEWER New-PSDrive loses OLDER 'net use' command. - by S.K. _

Status : 


Sign in
to vote
ID 775552 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 1/1/2013 10:31:32 PM
Access Restriction Public


see here. 

How to Map Network Drives Using PowerShell

>>> net use M: \\touchsmart\Share /Persistent:Yes

>>> New-PSDrive –Name “K” –PSProvider FileSystem –Root “\\touchsmart\share” –Persist


** I'm not saying a joke, I have to emphasize, because I want you to seriously resolve. **

If a $PSDefaultParameterValues's bug are fixed, he can win with using 'profile.ps1'.

>>> New-PSDrive K –Root \\touchsmart\share

--------------------------- 'profile.ps1' ---------------------------

 $PSDefaultParameterValues['New-PSDrive:PSProvider'] = "FileSystem"

  *** following code does not work now  ***
  *** see here  ***

 $PSDefaultParameterValues['New-PSDrive:Persist'] = {
 if("Root" -in $args[0].BoundParameters
    -and $PSBoundParameters["Root"].StartsWith('//')
    -and $PSBoundParameters["PSProvider"] -eq "FileSystem"
  ) { $true }


Do you say 'You can use a custom function' ?
Please remenber we do not like a custom function which is not valid for others.
Sign in to post a comment.