V
V
Vladimir2018-07-03 23:49:06
PowerShell
Vladimir, 2018-07-03 23:49:06

How to share files between two remote computers using PowerShell Remoting?

You need to copy a file from one remote PC ( Win 8.1 ) to another remote PC ( Win 8.1 ). I work on a PC with Win 10 . I enter the following:

$pc1 = New-PSSession RemotePC1 -credential ""
$pc2 = New-PSSession RemotePC2 -credential ""
Enter-PSSession $pc1
Copy-Item -path "C:\Users\RemotePC1\Desktop\file.txt -destination "C:\Users\RemotePC2\Desktop -ToSession $pc2"

Thus, it is not possible to exchange a file between sessions . How to transfer a file from one session to another ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
azarij, 2018-07-03
@bossonojka

and if so?
copy-item \\remote-pc1\c$\test\file.txt \\remote-pc2\d$\test\

V
Vadim Choporov, 2018-07-04
@tolstyiii

Why do you need remouting to copy files? Standard exchange via smb and all - remoting for administration. You can also dig a hole with a fork - but there are more suitable tools for this)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question