I am using NET USE to map a drive to a SharePoint library (using WEBDAV). When I do this in a DOS command prompt, everything works perfectly. I map the drive, the drive letter is instantly accessible, I can list contents with DIR and everything works great. But when I use the same command in PowerShell, the drive does map, but when I try to run a DIR against the new drive letter, it's not accessible.
CODE
cls net use q: "http://MyPath/Server Build Requests" Get-ChildItem q:\ net use q: /delete
ERROR
Get-ChildItem : Cannot find drive. A drive with the name 'q' does not exist. At C:\Users\MyUser\AppData\Local\Temp\2\c64dbe78-c74e-401e-b39f-405165a31e13.ps1:5 char:14+ Get-ChildItem <<<< q:\+ CategoryInfo : ObjectNotFound: (q:String) [Get-ChildItem], DriveNotFoundException+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
Any help would be appreciated!