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

Solution 1:

Try this:

net use * /delete /y

The /y key makes it select Yes in prompt silently