0

I have two computers, both windows 64-bit machines. Call the local computer machine A and the remote computer machine B. I have a script.py file on machine A. Without leaving machine A, I want to:

  1. Copy script.py onto machine B;
  2. Run script.py on machine B;
  3. Get the output on machine A.

I'm having problems with step 1.

Steps 2. and 3. are solved already.

I've configured both computers so that I can successfully run from PowerShell6 Invoke-Commands. The PSSessions established between machine A and B are functional. I can successfully run a script.py that is on machine B from machine A:

Enter-PSSession -hostname $hostname -username pshell 
-ScriptBlock{c:\Users\pshell\Anaconda3\python.exe script.py};

and get the output back to machine A. However, I don't know find the commands to copy script.py from machine A to machine B. I think it's a relatively easy task but I can't find the relevant commands. Any indications/suggestions not including third-party software/packages are welcome.

Sparky05
  • 4,692
  • 1
  • 10
  • 27
sovann
  • 117
  • 1
  • 1
  • 12

2 Answers2

0

From Is there a SCP alternative for PowerShell?: the little tool pscp.py, which comes with Putty can solve your task 1.

For an example with PowerShell see this answer.

Sparky05
  • 4,692
  • 1
  • 10
  • 27
0

Copy-Item -Path "ENTER_PATH HERE" -Destination "ENTER_PATH_HERE" -Recurse

Viking
  • 1
  • 4