0

When I log in remotely using PowerShell, I'm placed in a default location:

> Enter-PSSession SERVER
[SERVER]: PS C:\Users\smithe\Documents>

I'd like to copy a folder recursively to this location without having to specify it explicitly, something along the lines of:

> Copy-Item -Path .\LocalFolder -Destination \\SERVER\: -Recurse

Obviously the colon above is the wrong syntax--I'm only using it since that's what one would use using scp:

scp -r ./LocalFolder server:
Eric Smith
  • 259
  • 1
  • 4
  • 9
  • If you only need to copy something to a remote server, why do you want to create a session to it first? Does the answer to the following question answer your question too? http://stackoverflow.com/questions/10741609/copy-file-remotely-with-powershell – Johan de Haan Jun 19 '15 at 09:23
  • @JohandeHaan No, that's not what I want. I would like to know how to determine the "default" location when copying "to" a server. When using `scp` on Linux, if you postfix with a colon for the destination, the file is copied, by default into your home directory. – Eric Smith Jun 19 '15 at 16:34

0 Answers0