icomasoft PowerScripter 1.5  
run-scp

Name

Run-SCP

Synopsis

Runs a command through a SSH connection.

Syntax

Run-SCP Source <String> Destination<String> [-User] <String> [-Password] <String> [-Credential] <Credential> [-Certificate] <String>

Related Commands

Connect-SSH

Detailed Description

Copy a file through a SSH connection. Run-SCP can use an established connection (Connect-SSH) or create a new connection for file copy.

Parameters

 Name  Description  Required?  Pipeline Input
 Source  Source file to copy  True  False
 Target  Destination Directory  True  False
 User  Specifies a user name for authenticating with the server.  False  False
 Password  Specifies a password for authenticating with the server.  False  False
 Credential  Specifies the Credential object for authenticating with the server.  False  False
 Certificate  Specifies the Certificate for authenticating with the server.  False

 False

Input Type

none

Return Type

Command Output

Examples

Run-SCP c:\testfile.txt 192.168.1.201:/tmp

Copy the source file c:\testfile.txt to /tmp to the remote SSH Server (already connected by Connect-SSH). Be aware if connected with Connect-SSH the same SSH Server Name/IP must be used.

Run-SCP -Source 192.168.1.201:/etc/vmware/esx.conf -Destination c:\ESXhost-config

Copy the source file /etc/vmware/esx.conf from the remote SSH Server (already connected by Connect-SSH) to local directory c:\ESXhost-config.

Run-SCP 192.168.1.201:/etc/vmware/esx.conf c:\ESXhost-config -user root -password letmein

Copy the source file /etc/vmware/esx.conf from the remote SSH Server to local directory c:\ESXhost-config by creating a SSH connection.


 
Copyright © 2009 icomasoft ag, Switzerland