Search code examples
powershellwindows-7-x64powershell-5.0

Mapped network drives are not showing in My Computer


I am trying to create a external network drive using PowerShell 5.0. I Need those drive to display in My Computer. For that purpose I am using this follow command.

New-PSDrive -Name "X" -PSProvider FileSystem -Root "\\192.168.0.1\hde_path" -Persist

Is there anything wrong with this command? Because as per my understanding if I use -Persist it is should be displayed in the My Computer window.

After using this, the mapped drive X: is not being displayed in My Computer.


Solution

  • Welcome to Windows 10 and the endless problems of forced User Account Control.

    You will note if you map network drives in Computer then run PowerShell as admin, you cannot access the drives. I assume the reverse is also true.

    Unfortunately there isn't a way to turn off this "feature", at least not without breaking half of everything else. You just have to manage the access level you run PowerShell as, mapping network drives has to be done at the user level.