Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 457
Srijani Ghosh Avatar asked Oct 29 '22 11:10

Srijani Ghosh


2 Answers

I had the same problem. My solution was to start the powershell ISE in "Normal-Mode" instead of the "Administrator-Mode" (PS run as Admin). I don't know why this phenomen appears, but the drives were displayed in explorer after I run the powershell ISE in Normal-Mode. Greets

like image 83
Lorchi Avatar answered Nov 15 '22 07:11

Lorchi


When I run this from a script, it does not work, because the session expires on script completion.

It works when I paste into the PowerShell window, and then I can see the share appear in This PC

like image 32
mcolhoun Avatar answered Nov 15 '22 07:11

mcolhoun