new-smbmapping: finally fix the bug so that Windows Explorer recognizes the new drives without kill & restart
Since years(!), it's well known that if we map SMB Shares using the New-SmbMapping command,
then the Windows Explorer does not recognize the new Drives: we have to kill and restart explorer.exe.
Well, we can be happy that we do not have to reboot...
We can not believe that this bug was never fixed and that we have to raise our user voice to solicitation so that such annoying bugs get finally fixed.
Of course, we could use the New-PSDrive command.
Unfortunately, this command is even worse: it does not validate if the credentials are valid nor if the SMB UNC Path is valid. This will lead to 'mapped' Drive letters which are not accessible at all. Therefore, Users have to deconnect the invalid drive - and to reconnect it again. Manually.
You probably remember: 20 years ago, Windows detected such problems during the onconnect event and asked the user for the missing / wrong information. Automatically.
Of course, we could use "net use". Of course, we could us batch files, too.
But for sure, it would be much more useful if powershell commands just works as expected.
The 1st time right.
I'm pretty sure it's not presumptuous if Microsoft starts spending some of the billions profit to write again software which accomplish the basics as expected.
Maybe you could start anf fixing this uservoice-form so that this textbox will display more than 4x100 characters. You know: some useful thing.
Adrian Grigore commented
The problem still exists in Windows Server 2019.
Additionally the New-SMBMapping CmdLet badly needs a Credential parameter. Supplying credentials using cleartext -Username & -Password parameters is not appropirate