Forum Discussion
MatthewMcDonald_ews
May 20, 2022Brass Contributor
New-SMBMapping not showing in Explorer until Explorer process is closed/restarted
I'm writing a script to remap drives to new paths (file server migration), and I had everything working. I'm using Remove-SMBMapping and New-SMBMapping. While it was working there was a strange ...
MatthewMcDonald_ews
May 23, 2022Brass Contributor
I'm glad I'm not the only one!!!
MatthewMcDonald_ews
May 23, 2022Brass Contributor
I'm seeing some weird back and forth now. I am using Terminal too (as well as VSCode), where both were broken, so I decided to try regular Windows Powershell outside of Terminal. New-PSDrive works there, but only if I add the -Persist option. It also works with the raw NET USE command.
But after doing the, now New-PSDrive is working in Terminal\Powershell and Terminal\Windows Powershell again. I'm confused.
But New-SMBMapping still is broken everywhere (where it used to work).
But after doing the, now New-PSDrive is working in Terminal\Powershell and Terminal\Windows Powershell again. I'm confused.
But New-SMBMapping still is broken everywhere (where it used to work).
- May 23, 2022Adding persist does map it instant, remove-psdrive -Name X doesnt but net use x: /d does... But not running it from a script... It could work as a loginscript before the computer desktop is shown to the user I guess?
- MatthewMcDonald_ewsMay 23, 2022Brass ContributorUnfortunately this is a script users will trigger manually from SCCM Software Center.
Here's an even more interesting one for ya.
In WPSH, I did a New-SMBMapping. In Terminal PoSH, a Get-PSDrive sees that new mapping, yet when trying to run Remove-PSDrive, it says there is no such mapping to remove. But I can run same Remove-PSDrive command from the original WPSH and it unmaps that connection fine.
I guess this is going to have to be one for the Windows dev team to figure out. Clearly something is wrong.- Jun 01, 2022Any luck in figuring out another solution?