Connect-SFTPCmdlet

Parameters   Output Objects   Config Settings  

The Connect-SFTP cmdlet is used to create a persistent connection object.

Syntax

$cnn = Connect-SFTP [parameters]

Remarks

This cmdlet allows you to create a persistent connection object to be used with related cmdlets.

When executing the cmdlet a connection object is returned. Pass this object to the Connection parameter of related cmdlets to use the newly created connection object.

To disconnect call Disconnect-SFTP.

Parameter List


The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.

LogFileThe location of a file to which debug information is written.
AfterConnectA set of FTP commands to be executed immediately after connecting to the Server .
AuthModeThe type of authentication used by the component.
CertPasswordThe password to the certificate store.
CertStoreThe name of the certificate store for the client certificate.
CertStoreTypeThe type of certificate store for the client certificate.
CertSubjectThe subject of the certificate used for client authentication.
CompressionAlgorithmsA comma-separated list containing all allowable compression algorithms.
ConfigSpecifies one or more configuration settings.
CredentialThe PSCredential object to use for user/password authentication.
EncryptionAlgorithmsA comma-separated list containing all allowable compression algorithms.
FirewallHostName or IP address of firewall.
FirewallPasswordA password if authentication is to be used when connecting through the firewall.
FirewallPortThe port of the firewall to which to connect.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
ForceForces the component to accept the default behavior instead of querying the user.
LocalIPThe IP address of the local interface to use.
LogFileThe location of a file to which debug information is written.
PasswordThe password to use for authentication.
PasswordPromptThe shell prompt used for keyboard-interactive authentication.
PortThe TCP port in the remote host to which to connect.
ServerThe address of the Server.
SSHAcceptThe hex-encoded fingerprint of the host to trust explicitly.
TimeoutThe maximum time allowed for the operation.
UserThe username to use for authentication.

Output Objects


The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.

SFTPConnectionThe connection object.

Config Settings


The following is a list of config settings for the cmdlet with short descriptions. Click on the links for further details.

AllowBackslashInNameWhether backslashes are allowed in folder and file names.
AsyncTransferControls whether simultatenous requests are made to read or write files.
AttrAccessTimeCan be queried for the AccessTime file attribute during the DirList event.
AttrCreationTimeCan be queried for the CreationTime file attribute during the DirList event.
AttrFileTypeCan be queried for the FileType file attribute during the DirList event.
AttrGroupIdCan be queried for the GroupId file attribute during the DirList event.
AttrLinkCountCan be queried for the LinkCount file attribute during the DirList event.
AttrOwnerIdCan be queried for the OwnerId file attribute during the DirList event.
AttrPermissionCan be queried for the Permissions file attribute during the DirList event.
CheckFileHashCompares a server-computed hash with a hash calculated locally.
CopyRemoteDataCopies a specified range of bytes in one file to another.
CopyRemoteFileCopies a file from one location to another directly on the server.
DisableRealPathControls whether or not the SSH_FXP_REALPATH request is sent.
ExcludeFileMaskSpecifies a file mask for excluding files in directory listings.
FileMaskDelimiterSpecifies a delimiter to use for setting multiple file masks in the RemoteFile property.
FiletimeFormatSpecifies the format to use when returning filetime strings.
FreeSpaceThe free space on the remote server in bytes.
GetSpaceInfoQueries the server for drive usage information.
GetSymlinkAttrsWhether to get the attributes of the symbolic link, or the resource pointed to by the link.
IgnoreFileMaskCasingControls whether or not the file mask is case sensitive.
LocalEOLWhen TransferMode is set, this specifies the line ending for the local system.
LogSFTPFileDataWhether SFTP file data is present in Debug logs.
MaskSensitiveMasks passwords in logs.
MaxFileDataSpecifies the maximum payload size of an SFTP packet.
MaxOutstandingPacketsSets the maximum number of simultaneous read or write requests allowed.
NegotiatedProtocolVersionThe negotiated SFTP version.
NormalizeRemotePathWhether to normalize the RemotePath.
PreserveFileTimePreserves the file's timestamps during transfer.
ProtocolVersionThe highest allowable SFTP version to use.
ReadLinkThis settings returns the target of a specified symbolic link.
RealPathControlFlagSpecifies the control-byte field sent in the SSH_FXP_REALPATH request.
RealTimeUploadEnables real time uploading.
RealTimeUploadAgeLimitThe age limit in seconds when using RealTimeUpload.
ServerEOLWhen TransferMode is set, this specifies the line ending for the remote system.
SimultaneousTransferLimitThe maximum number of simultaneous file transfers.
TotalSpaceThe total space on the remote server in bytes.
TransferModeThe transfer mode (ASCII or Binary).
TransferredDataLimitSpecifies the maximum number of bytes to download from the remote file.
UseFxpStatWhether SSH_FXP_STAT is sent.
UseServerFileTimeControls if the file time returned from the server is converted to local time or not.
UseServerFileTimeControls if the file time returned from the server is converted to local time or not.
ChannelDataEOL[ChannelId]Used to break the incoming data stream into chunks.
ChannelDataEOLFound[ChannelId]Determines if ChannelDataEOL was found.
ClientSSHVersionStringThe SSH version string used by the component.
EnablePageantAuthWhether to use a key stored in Pageant to perform client authentication.
KerberosDelegationIf true, asks for credentials with delegation enabled during authentication.
KerberosRealmThe fully qualified domain name of the Kerberos Realm to use for GSSAPI authentication.
KerberosSPNThe Kerberos Service Principal Name of the SSH host.
KeyRenegotiationThresholdSets the threshold for the SSH Key Renegotiation.
LogLevelSpecifies the level of detail that is logged.
MaxChannelDataLength[ChannelId]The maximum amount of data to accumulate when no ChannelDataEOL is found.
MaxPacketSizeThe maximum packet size of the channel, in bytes.
MaxWindowSizeThe maximum window size allowed for the channel, in bytes.
PasswordPromptThe text of the password prompt used in keyboard-interactive authentication.
PreferredDHGroupBitsThe size (in bits) of the preferred modulus (p) to request from the server.
RecordLengthThe length of received data records.
ServerSSHVersionStringThe remote host's SSH version string.
SignedSSHCertThe CA signed client public key used when authenticating.
SSHAcceptAnyServerHostKeyIf set the component will accept any key presented by the server.
SSHAcceptServerCAKeyThe CA public key that signed the server's host key.
SSHAcceptServerHostKeyFingerPrintThe fingerprint of the server key to accept.
SSHFingerprintHashAlgorithmThe algorithm used to calculate the fingerprint.
SSHFingerprintMD5The server hostkey's MD5 fingerprint.
SSHFingerprintSHA1The server hostkey's SHA1 fingerprint.
SSHFingerprintSHA256The server hostkey's SHA256 fingerprint.
SSHKeepAliveCountMaxThe maximum number of keep alive packets to send without a response.
SSHKeepAliveIntervalThe interval between keep alive packets.
SSHKeyExchangeAlgorithmsSpecifies the supported key exchange algorithms.
SSHKeyRenegotiateCauses the component to renegotiate the SSH keys.
SSHMacAlgorithmsSpecifies the supported Mac algorithms.
SSHPubKeyAuthSigAlgorithmsSpecifies the enabled signature algorithms that may be used when attempting public key authentication.
SSHPublicKeyAlgorithmsSpecifies the supported public key algorithms for the server's public key.
SSHVersionPatternThe pattern used to match the remote host's version string.
TryAllAvailableAuthMethodsIf set to true, the component will try all available authentication methods.
UseStrictKeyExchangeSpecifies how strict key exchange is supported.
WaitForChannelCloseWhether to wait for channels to be closed before disconnected.
WaitForServerDisconnectWhether to wait for the server to close the connection.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the component whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the component binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
MaskSensitiveWhether sensitive data is masked in log messages.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

LogFile Parameter (Connect-SFTP Cmdlet)

The location of a file to which debug information is written.

Syntax

Connect-SFTP -LogFile string

Remarks

When specified, the cmdlet will log debug information to the file. If the file exists, the information will be appended.

Default Value

null

AfterConnect Parameter (Connect-SFTP Cmdlet)

A set of FTP commands to be executed immediately after connecting to the Server .

Syntax

Connect-SFTP -AfterConnect string[]

Remarks

Default Value

null

AfterDownload Parameter (Connect-SFTP Cmdlet)

A set of FTP commands to be executed immediately after each file downloaded.

Syntax

Connect-SFTP -AfterDownload string[]

Remarks

Default Value

null

AuthMode Parameter (Connect-SFTP Cmdlet)

The type of authentication used by the component.

Syntax

Connect-SFTP -AuthMode string

Remarks

Default Value

2

BeforeDownload Parameter (Connect-SFTP Cmdlet)

A set of FTP commands to be executed immediately before each file is downloaded.

Syntax

Connect-SFTP -BeforeDownload string[]

Remarks

Default Value

null

CertPassword Parameter (Connect-SFTP Cmdlet)

The password to the certificate store.

Syntax

Connect-SFTP -CertPassword string

Remarks

Default Value

""

Parameter Alias

CertificatePassword

CertStore Parameter (Connect-SFTP Cmdlet)

The name of the certificate store for the client certificate.

Syntax

Connect-SFTP -CertStore string

Remarks

Default Value

"MY"

Parameter Alias

CertificateStore

CertStoreType Parameter (Connect-SFTP Cmdlet)

The type of certificate store for the client certificate.

Syntax

Connect-SFTP -CertStoreType string

Remarks

Default Value

0

CertSubject Parameter (Connect-SFTP Cmdlet)

The subject of the certificate used for client authentication.

Syntax

Connect-SFTP -CertSubject string

Remarks

Default Value

"*"

CompressionAlgorithms Parameter (Connect-SFTP Cmdlet)

A comma-separated list containing all allowable compression algorithms.

Syntax

Connect-SFTP -CompressionAlgorithms string

Remarks

Default Value

"none"

Config Parameter (Connect-SFTP Cmdlet)

Specifies one or more configuration settings.

Syntax

Connect-SFTP -Config string[]

Remarks

Default Value

null

Credential Parameter (Connect-SFTP Cmdlet)

The PSCredential object to use for user/password authentication.

Syntax

Connect-SFTP -Credential PSCredential

Remarks

Default Value

null

Parameter Position

1

Parameter Alias

auth

EncryptionAlgorithms Parameter (Connect-SFTP Cmdlet)

A comma-separated list containing all allowable compression algorithms.

Syntax

Connect-SFTP -EncryptionAlgorithms string

Remarks

Default Value

"aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,arcfour256,arcfour128,arcfour,cast128-cbc,aes256-gcm@openssh.com,aes128-gcm@openssh.com"

FirewallHost Parameter (Connect-SFTP Cmdlet)

Name or IP address of firewall.

Syntax

Connect-SFTP -FirewallHost string

Remarks

Default Value

""

FirewallPassword Parameter (Connect-SFTP Cmdlet)

A password if authentication is to be used when connecting through the firewall.

Syntax

Connect-SFTP -FirewallPassword string

Remarks

Default Value

""

FirewallPort Parameter (Connect-SFTP Cmdlet)

The port of the firewall to which to connect.

Syntax

Connect-SFTP -FirewallPort int

Remarks

Default Value

0

FirewallType Parameter (Connect-SFTP Cmdlet)

Determines the type of firewall to connect through.

Syntax

Connect-SFTP -FirewallType string

Remarks

Default Value

0

FirewallUser Parameter (Connect-SFTP Cmdlet)

A user name if authentication is to be used connecting through a firewall.

Syntax

Connect-SFTP -FirewallUser string

Remarks

Default Value

""

Force Parameter (Connect-SFTP Cmdlet)

Forces the component to accept the default behavior instead of querying the user.

Syntax

Connect-SFTP -Force SwitchParameter

Remarks

Default Value

false

List Parameter (Connect-SFTP Cmdlet)

Get a directory listing for the path and file mask specified.

Syntax

Connect-SFTP -List string

Remarks

Default Value

""

Parameter Alias

Path

LocalFile Parameter (Connect-SFTP Cmdlet)

The local file to download to.

Syntax

Connect-SFTP -LocalFile string

Remarks

Default Value

""

LocalIP Parameter (Connect-SFTP Cmdlet)

The IP address of the local interface to use.

Syntax

Connect-SFTP -LocalIP string

Remarks

Default Value

""

Parameter Alias

LocalAddress

LogFile Parameter (Connect-SFTP Cmdlet)

The location of a file to which debug information is written.

Syntax

Connect-SFTP -LogFile string

Remarks

Default Value

""

Overwrite Parameter (Connect-SFTP Cmdlet)

Indicates whether the LocalFile may be overwritten.

Syntax

Connect-SFTP -Overwrite SwitchParameter

Remarks

Default Value

false

Password Parameter (Connect-SFTP Cmdlet)

The password to use for authentication.

Syntax

Connect-SFTP -Password string

Remarks

Default Value

""

PasswordPrompt Parameter (Connect-SFTP Cmdlet)

The shell prompt used for keyboard-interactive authentication.

Syntax

Connect-SFTP -PasswordPrompt string

Remarks

Default Value

"password"

Port Parameter (Connect-SFTP Cmdlet)

The TCP port in the remote host to which to connect.

Syntax

Connect-SFTP -Port int

Remarks

Default Value

22

RemoteFile Parameter (Connect-SFTP Cmdlet)

The name of the remote file to download.

Syntax

Connect-SFTP -RemoteFile string

Remarks

Default Value

""

Parameter Position

1

Parameter Alias

Download

Server Parameter (Connect-SFTP Cmdlet)

The address of the Server.

Syntax

Connect-SFTP -Server string

Remarks

Default Value

""

Parameter Position

0

This is a required parameter.

SSHAccept Parameter (Connect-SFTP Cmdlet)

The hex-encoded fingerprint of the host to trust explicitly.

Syntax

Connect-SFTP -SSHAccept string

Remarks

Default Value

""

Parameter Alias

Fingerprint

Timeout Parameter (Connect-SFTP Cmdlet)

The maximum time allowed for the operation.

Syntax

Connect-SFTP -Timeout int

Remarks

Default Value

10

User Parameter (Connect-SFTP Cmdlet)

The username to use for authentication.

Syntax

Connect-SFTP -User string

Remarks

Default Value

""

SFTPConnection Output Object (Connect-SFTP Cmdlet)

The connection object.

Syntax

Object SFTPConnection {
   string[] AfterConnect;
   string AuthMode;
   string CertPassword;
   string CertStore;
   string CertStoreType;
   string CertSubject;
   string CompressionAlgorithms;
   string[] Config;
   PSCredential Credential;
   string EncryptionAlgorithms;
   string FirewallHost;
   string FirewallPassword;
   int FirewallPort;
   string FirewallType;
   string FirewallUser;
   SwitchParameter Force;
   string LocalIP;
   string LogFile;
   string Password;
   string PasswordPrompt;
   int Port;
   string Server;
   string SSHAccept;
   int Timeout;
   string User;
}

Remarks

This object holds the connection. It may be passed to the Connection parameter of related cmdlets.

Config Settings (Connect-SFTP Cmdlet)

SFTP Config Settings

FreeSpace:  
LocalEOL:  
ReadLink:  
ServerEOL:  

SSHClient Config Settings

LogLevel:  

TCPClient Config Settings

ConnectionTimeout:  
FirewallAutoDetect:  
FirewallHost:  
FirewallPassword:  
FirewallPort:  
FirewallType:  
FirewallUser:  
KeepAliveInterval:  
KeepAliveTime:  
Linger:  
LingerTime:  
LocalHost:  
LocalPort:  
MaxLineLength:  
MaxTransferRate:  
ProxyExceptionsList:  
TCPKeepAlive:  
TcpNoDelay:  
UseIPv6:  

Socket Config Settings

AbsoluteTimeout:  
FirewallData:  
InBufferSize:  
OutBufferSize:  

Base Config Settings

BuildInfo:  
CodePage:  
LicenseInfo:  
MaskSensitive:  
UseInternalSecurityAPI: