I’m a *nix guy, stuck in a windows world. So when I learned I could run Powershell on my beloved ubuntu box and admin my windows servers I had to give it a shot.
one of the first tasks, copy this file to that share… not a problem, lets use my new found powershell and
Copy-Item -Path //path/to/my/file -Destination //path/to/be/copied :enter
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.
enter good 'ole smbclient to save the day
smbclient -U username%password -W domain.tld //ip.of.the.server/share --directory directory/ -c "put test"
would it be possible to get Copy-Item to leverage this facility to complete this task?