Why “net use * /delete” does not work but waits for confirmation in my PowerShell script?
问题 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 : Multiple connections to a server or shared resource by the same user , using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again So I have this line: net use * /delete (Unfortunately I could not find a way to disconnect from a specific mapped drive just by providing the server name so