Please note: security is not an issue at all with this application.
I have a "MachineA" that has a file we will call file.txt. I need to get this file onto a "MachineB". Here's the catch, this needs to be done by remotely sending an Invoke-Command script from MachineB to MachineA to kick back the file.
What I have tried so far:
I have setup a shared drive (using net use) on MachineB that MachineA can access. This drive is known as z:\ to MachineA.
I can send this command via Invoke-Command from MachineB to MachineA and it will transfer a file from one directory to another directory within MachineA
xcopy c:\users\administrator\desktop\file.txt c:\file.txt
Now if I send the following command in the same manner from MachineB to MachineA it will complain about not being able to see drive Z.
xcopy c:\users\administrator\desktop\file.txt z:\FilesFromVMs\file.txt
Note: if run the second command directly on MachineA from powershell it will move the file but I need to be able to do this remotely via Invoke-Command
xcopy \\machineA\C$\users\administrator\desktop\file.txt C:\file.txtwill copy file from machineA to machineB. - James C.