Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Copy a text file from local pc to Windows VM using Powershell

$
0
0

Hello, I need to copy a text file form my pc into the Windows 2012 Vm and I should do it using powershell. I can connect to VM using Powershell remoting. I tried the following command but they don't work :

1)robocopy C:\Desktop\tests.txt -Destination myVM.cloudapp.net\c$ > this doesn't work becuase I can not enter credential

2)Copy-Item -Path C:\Desktop\tests.txt -Destination \\myVM.cloudapp.net\c$\test.txt > this doesn't work becuase I can not enter credential and I don't know how this command works without putting credential of the destination

3) Start-BitsTransfer C:\Desktop\tests.txt -Destination myVM.cloudapp.net\c$

The problem is that It can not find the path  > \\myVM.cloudapp.net

Any Help is highly appreciated.


Viewing all articles
Browse latest Browse all 8411