Closed pgrunm closed 6 years ago
in your example, you assign the value of $exportPath
to the [PSDriveInfo]
object, IE, its not a path, and I also don't know how Convert-Path $exportPath
works. You could do $($exportPath.Root)\Folder\File
.
I guess working with PSDrives is some kind of challenge. Anyway I found a way to resolve my issue so I'm closing this. 👍
Ok, I mean, PSDrives should have no issues. I was just saying that in your example, the variable you create does not hold a Path property, and that would be none of it is working:
PS C:\Users\dotps1> $drive = New-PSDrive -PSProvider FileSystem -Root $pwd -Name Test
PS C:\Users\dotps1> $drive
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Test 0.00 429.72 FileSystem C:\Users\dotps1
so like if tried to say Get-ChildItem $drive
its going to fail, because $drive isn't a path or a string, its a PSDriveInfo
object. So you would have to do Get-ChildItem $drive.Root
. Let me know if there is anything else we can look at. Thanks!
I had the similar issue. I have converted the path explicitly using convert-path. For example, $pathconverted = convert-path "PSDRIVE:/blah/blah". Kindly ignore if you have already found the solution
Issue Description
Hello,
I found an interesting bug in the WinSCP module when using PSDrives. I'm trying to send a file from a PSDrive to a remote server with
Send-WinSCPItem
. The PSDrive is a shortcut to a remote SMB drive. When I'm using a regular UNC path the module is fine.Example
Expected Output
Some more Powershell Output
Actual Output
WinSCP-PowerShell Version
No idea why it's not showing the right versionThis is the right version number from the Module data... I downloaded the module in mid of June.Environment
Also: