Why “net use * /delete” does not work but waits for confirmation in my PowerShell script?

后端 未结 2 1221
忘了有多久
忘了有多久 2020-12-14 06:02

I have a script where I want to disconnect from the mapped drives before I create a new PSDrive.

Otherwise I get this error:

New-PSDrive : Mul

2条回答
  •  Happy的楠姐
    2020-12-14 06:15

    With PowerShell 5.1 in Windows 10 you can use:

    Get-SmbMapping | Remove-SmbMapping -Confirm:$false
    

提交回复
热议问题