Forum Discussion
New-SMBMapping not showing in Explorer until Explorer process is closed/restarted
MatthewMcDonald_ews i searched same stuff like crazy the ansmwer is as such (and so badly documented you would want to scream aloud !
basically you need to use new-psdrive and add -scope global to your script and.... it works like a charm !
New-PSDrive -Name "J" -Root "UNC" -Persist -PSProvider "FileSystem" -scope global
hope this helps ....
kind regards
David
- RbovenkampAug 14, 2024Copper Contributor
KieranCork I think you're running pws as administrator. So the mapping is not visible under the logged in user.
- KieranCorkNov 15, 2022Copper Contributor
davidblum_dbciYeah, New-PSDrive is what I've been using. I'm pointing to a local directory (OneDrive), so perhaps that is the issue, as it doesn't let you use "-Persist" either.
- davidblum_dbciNov 15, 2022Copper Contributor
KieranCork i've moved away from new-smbmapping and use new-psdrive instead... is this the on you used ?
- KieranCorkNov 14, 2022Copper ContributorI've been searching for this solution for a while, and -scope global makes no difference for me. I've seen others also swear this works and replies to them saying it doesn't.
I wonder what the difference between our setups is. ¯\_(ツ)_/¯