I can see from your snippet it should be full UNC paths also single quote marks should be added for the destination folder if I’m not mistaken:
-Destination ‘D:\work\file.zip’
There are a few ways around this I will attach a few links for you to view that should do the trick:
Also could you please check you have permissions for the folder you are trying to copy across this has happened from time to time for people without the correct permissions to access the folder:
Thank you for your help. Unfortunately, these workaround didn’t work. Since my environment doesn’t have Active Directory, there are only local users on the servers. I was wondering if Octopus service account couldn’t have such permission to copy and paste between servers.
The way Octopus is configured it will run Powershell scripts from your host machine with privileges that the user account logged on has.
I suggest using regular network share on server B with write-only access to everyone and call (from Server A), so you can pass the files over to the machine.
This would be your best bet, given the circumstances you are in.