Copy-Item : Could not find a part of the path '/test/share/directory/'.
At line:1 char:1
+ Copy-Item -Path test -Destination //test/share/directory/
+ CategoryInfo : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
+ FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand
I cried myself to sleep that night, because I couldn't do a simple task like copy a file from one server to another.
In theory, yeah. I think the problem – and I'm not a Linux guy, so I'm guessing – is that while Windows has an SMB client running all the time, Linux doesn't. Copy-Item is just asking the underlying OS to handle the copy, so if the OS doesn't "know" how to handle an SMB path, it'll fail, and the error you're seeing is the result of that. Copy-Item is relatively "dumb" in that way – it doesn't know it needs to load a specific client or anything. Essentially, if cp can't do it, Copy-Item is likely to fail also. You'd need to somehow have an SMB client loaded and running before going into PowerShell to begin with.