EDIT: Alt title: New-PSDrive in Powershell not working the same as NET USE in bat
I'm trying to load a python script in WinPython off a UNC Path, so I need to map it to a drive. I have all this working in a bat file but can't get it to work in Powershell.
NET USE P: "\\networkPath\WinPython\WinPython-32bit-188.8.131.52Zero" PUSHD P:\ "P:\python-3.6.1\python.exe" "P:\loadRemix3D.pyw"
New-PSDrive -Name P -PSProvider FileSystem -Root \\networkPath\WinPython\WinPython-32bit-184.108.40.206Zero Push-Location -Path P:\ Start-Process -FilePath P:\python-3.6.1\python.exe -WorkingDirectory P:\python-3.6.1 -ArgumentList P:\loadRemix3D.pyw
The pathing is correct as in the Powershell correctly executes Python and loads the Python script, but the Python script's pathing behaves as though I loaded it directly from UNC.
How do I make the Powershell work the same as the bat?
EDIT: As per Jeff's answer, here is a working version of the Powershell script:
NET USE P: "\\networkPath\WinPython\WinPython-32bit-220.127.116.11Zero" Push-Location -Path P:\ Start-Process -Wait -FilePath "P:\python-3.6.1\pythonw.exe" -WorkingDirectory "P:\python-3.6.1" -ArgumentList "P:\loadRemix3D.pyw" NET USE P: /delete /y
The only other thing I needed to add was to explicitly delete the mapping since it appears that NET USE mappings persist in the global PowerShell context(?).