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.
LogFile | The location of a file to which debug information is written. |
AfterConnect | A set of FTP commands to be executed immediately after connecting to the Server . |
AuthMode | The type of authentication used by the component. |
CertPassword | The password to the certificate store. |
CertStore | The name of the certificate store for the client certificate. |
CertStoreType | The type of certificate store for the client certificate. |
CertSubject | The subject of the certificate used for client authentication. |
CompressionAlgorithms | A comma-separated list containing all allowable compression algorithms. |
Config | Specifies one or more configuration settings. |
Credential | The PSCredential object to use for user/password authentication. |
EncryptionAlgorithms | A comma-separated list containing all allowable compression algorithms. |
FirewallHost | Name or IP address of firewall. |
FirewallPassword | A password if authentication is to be used when connecting through the firewall. |
FirewallPort | The port of the firewall to which to connect. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
Force | Forces the component to accept the default behavior instead of querying the user. |
LocalIP | The IP address of the local interface to use. |
LogFile | The location of a file to which debug information is written. |
Password | The password to use for authentication. |
PasswordPrompt | The shell prompt used for keyboard-interactive authentication. |
Port | The TCP port in the remote host to which to connect. |
Server | The address of the Server. |
SSHAccept | The hex-encoded fingerprint of the host to trust explicitly. |
Timeout | The maximum time allowed for the operation. |
User | The 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.
SFTPConnection | The 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.
AllowBackslashInName | Whether backslashes are allowed in folder and file names. |
AsyncTransfer | Controls whether simultatenous requests are made to read or write files. |
AttrAccessTime | Can be queried for the AccessTime file attribute during the DirList event. |
AttrCreationTime | Can be queried for the CreationTime file attribute during the DirList event. |
AttrFileType | Can be queried for the FileType file attribute during the DirList event. |
AttrGroupId | Can be queried for the GroupId file attribute during the DirList event. |
AttrLinkCount | Can be queried for the LinkCount file attribute during the DirList event. |
AttrOwnerId | Can be queried for the OwnerId file attribute during the DirList event. |
AttrPermission | Can be queried for the Permissions file attribute during the DirList event. |
CheckFileHash | Compares a server-computed hash with a hash calculated locally. |
CopyRemoteData | Copies a specified range of bytes in one file to another. |
CopyRemoteFile | Copies a file from one location to another directly on the server. |
DisableRealPath | Controls whether or not the SSH_FXP_REALPATH request is sent. |
ExcludeFileMask | Specifies a file mask for excluding files in directory listings. |
FileMaskDelimiter | Specifies a delimiter to use for setting multiple file masks in the RemoteFile property. |
FiletimeFormat | Specifies the format to use when returning filetime strings. |
FreeSpace | The free space on the remote server in bytes. |
GetSpaceInfo | Queries the server for drive usage information. |
GetSymlinkAttrs | Whether to get the attributes of the symbolic link, or the resource pointed to by the link. |
IgnoreFileMaskCasing | Controls whether or not the file mask is case sensitive. |
LocalEOL | When TransferMode is set, this specifies the line ending for the local system. |
LogSFTPFileData | Whether SFTP file data is present in Debug logs. |
MaskSensitive | Masks passwords in logs. |
MaxFileData | Specifies the maximum payload size of an SFTP packet. |
MaxOutstandingPackets | Sets the maximum number of simultaneous read or write requests allowed. |
NegotiatedProtocolVersion | The negotiated SFTP version. |
NormalizeRemotePath | Whether to normalize the RemotePath. |
PreserveFileTime | Preserves the file's timestamps during transfer. |
ProtocolVersion | The highest allowable SFTP version to use. |
ReadLink | This settings returns the target of a specified symbolic link. |
RealPathControlFlag | Specifies the control-byte field sent in the SSH_FXP_REALPATH request. |
RealTimeUpload | Enables real time uploading. |
RealTimeUploadAgeLimit | The age limit in seconds when using RealTimeUpload. |
ServerEOL | When TransferMode is set, this specifies the line ending for the remote system. |
SimultaneousTransferLimit | The maximum number of simultaneous file transfers. |
TotalSpace | The total space on the remote server in bytes. |
TransferMode | The transfer mode (ASCII or Binary). |
TransferredDataLimit | Specifies the maximum number of bytes to download from the remote file. |
UseFxpStat | Whether SSH_FXP_STAT is sent. |
UseServerFileTime | Controls if the file time returned from the server is converted to local time or not. |
UseServerFileTime | Controls 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. |
ClientSSHVersionString | The SSH version string used by the component. |
EnablePageantAuth | Whether to use a key stored in Pageant to perform client authentication. |
KerberosDelegation | If true, asks for credentials with delegation enabled during authentication. |
KerberosRealm | The fully qualified domain name of the Kerberos Realm to use for GSSAPI authentication. |
KerberosSPN | The Kerberos Service Principal Name of the SSH host. |
KeyRenegotiationThreshold | Sets the threshold for the SSH Key Renegotiation. |
LogLevel | Specifies the level of detail that is logged. |
MaxChannelDataLength[ChannelId] | The maximum amount of data to accumulate when no ChannelDataEOL is found. |
MaxPacketSize | The maximum packet size of the channel, in bytes. |
MaxWindowSize | The maximum window size allowed for the channel, in bytes. |
PasswordPrompt | The text of the password prompt used in keyboard-interactive authentication. |
PreferredDHGroupBits | The size (in bits) of the preferred modulus (p) to request from the server. |
RecordLength | The length of received data records. |
ServerSSHVersionString | The remote host's SSH version string. |
SignedSSHCert | The CA signed client public key used when authenticating. |
SSHAcceptAnyServerHostKey | If set the component will accept any key presented by the server. |
SSHAcceptServerCAKey | The CA public key that signed the server's host key. |
SSHAcceptServerHostKeyFingerPrint | The fingerprint of the server key to accept. |
SSHFingerprintHashAlgorithm | The algorithm used to calculate the fingerprint. |
SSHFingerprintMD5 | The server hostkey's MD5 fingerprint. |
SSHFingerprintSHA1 | The server hostkey's SHA1 fingerprint. |
SSHFingerprintSHA256 | The server hostkey's SHA256 fingerprint. |
SSHKeepAliveCountMax | The maximum number of keep alive packets to send without a response. |
SSHKeepAliveInterval | The interval between keep alive packets. |
SSHKeyExchangeAlgorithms | Specifies the supported key exchange algorithms. |
SSHKeyRenegotiate | Causes the component to renegotiate the SSH keys. |
SSHMacAlgorithms | Specifies the supported Mac algorithms. |
SSHPubKeyAuthSigAlgorithms | Specifies the enabled signature algorithms that may be used when attempting public key authentication. |
SSHPublicKeyAlgorithms | Specifies the supported public key algorithms for the server's public key. |
SSHVersionPattern | The pattern used to match the remote host's version string. |
TryAllAvailableAuthMethods | If set to true, the component will try all available authentication methods. |
UseStrictKeyExchange | Specifies how strict key exchange is supported. |
WaitForChannelClose | Whether to wait for channels to be closed before disconnected. |
WaitForServerDisconnect | Whether to wait for the server to close the connection. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseIPv6 | Whether to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitive | Whether sensitive data is masked in log messages. |
UseInternalSecurityAPI | Tells 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;
}