Copy Over PowerShell Remoting Sessions

by May 24, 2016

You can use PowerShell remoting to transfer files across a network – this is new in PowerShell 5.0.

This can be useful in closed environments where you have no SMB file shares. It is not very efficient (and slow) though. Here is an example:

# Create a session to the target computer (assuming you have set up PowerShell remoting before)
$session = New-PSSession -ComputerName dc-01
# Copy a file from the target to your computer
# Specify the local path for the file on the target system
Copy-Item -FromSession $session -Path C:\windows\DPINST.LOG -Destination C:\test

Twitter This Tip! ReTweet this Tip!