Get-FTP Cmdlet

Parameters   Output Objects   Configuration Settings  

The Get-FTP component is used to download files and retrieve directory listings from FTP, SFTP, and FTPS servers.

Syntax

Get-FTP [parameters]

Remarks

This cmdlet implements a standard FTP client, as specified in RFC 959 and RFC 1579. In addition, it also includes the added option of SSL security (RFC 2228) in both the protocol and data channels.

To use the cmdlet to download a file, you must specify the Server, User, and Password. The file to download from is given by RemoteFile, and the file to download to is specified by LocalFile.

Directory listings may be retrieved by setting List to the remote path of which you wish to receive a directory listing. Results of a directory listing will be returned in one or more EntryInfo objects.

To use FTPS (SSL-enabled FTP), set SSL to True.

This cmdlet handles listing directories and downloading files. To upload files please see the SEND-FTP cmdlet.

The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.


# Retrieve all txt files from a subdirectory on a FTP server
Get-FTP -Server ftp_server -User user -Password password -RemoteFile Folder1/SubFolder/*.txt

# Lists all .txt file on a FTP server.
Get-FTP -Server ftp_server -Cred $cred -List *.txt -SSL explicit

Connection Handling

This cmdlet supports persistent connections through the Connection parameter. To establish a new FTP connection, use the Connect-FTP cmdlet. To close the connection, use the Disconnect-FTP cmdlet.

Parameter List


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

ConnectionAn already established connection.
LogFileThe location of a file to which debug information is written.
ActiveModeControls whether to direct the server into active mode.
AfterConnectA set of FTP commands to be executed immediately after connecting to the Server .
AfterDownloadA set of FTP commands to be executed immediately after each file downloaded.
AuthModeThe type of authentication used by the component.
BeforeDownloadA set of FTP commands to be executed immediately before each file is downloaded.
BinaryForces binary transfer mode for FTP and FTPS connections.
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.
ConfigSpecifies one or more configuration settings.
CredentialThe PSCredential object to use for user/password authentication.
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.
ListGet a directory listing for the path and file mask specified.
LocalFileThe local file to download to.
LocalIPThe IP address of the local interface to use.
LogFileThe location of a file to which debug information is written.
OverwriteIndicates whether the LocalFile may be overwritten.
PasswordThe password to use for authentication.
PortThe TCP port in the remote host to which to connect.
RemoteFileThe name of the remote file to download.
ServerThe address of the Server.
SSLDetermines how the component starts SSL negotiation.
SSLAcceptThe encoded public key of the certificate which is to be trusted 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.

EntryInfoThis object contains details about a file returned from the FTP Server .
FTPFileThis object is created after a file has finished transferring.

Configuration Settings


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

UseFSwitchSpecifies whether or not the -F parameter is used when listing directory contents.
UseSimpleDirListInstructs the adapter to issue the NLST command instead of LIST.
ActiveModeIPAllows the specification of the IP address that the server will connect to for active mode connections.
ActiveModePORTAddressAllows the specification of the PORT address value for active mode connections.
AppendToLocalFileAppend downloaded files to a local file.
ApplyFileMaskLocallyWhether to filter the directory listing locally or on the server.
AutoSelectDataIPAutomatically select the data connection IP.
CalculatePercentDoneEnables or Disables calculating the percent complete for downloads.
CheckTotalEntryWhether to ignore directory listing total lines.
DILingerWhen set to True, DI connections are terminated gracefully.
DILingerTimeTime in seconds to have the DI connection linger.
FileTimeFormatThe format of file time reported by the server.
IgnoreEntriesDirectory entry data to ignore.
MaskSensitiveMasks passwords in logs.
ModeZCompressionLevelUsed to specify the level of compression used.
PortRangeAllows the specification of a port range where the component listens for active mode connections.
PreserveFileTimeAttempts to preserve timestamps when transferring files.
RealTimeUploadEnables real time uploading.
RealTimeUploadAgeLimitThe age limit in seconds when using RealTimeUpload.
ReusePISSLSessionInDIWhether the PI SSL session will be reused for the DI connection.
ReuseSSLSessionInDIWhether the SSL session will be reused for the DI connection.
UseClearChannelAllows for the Clear Command Channel (CCC) command.
UseClearDataChannelAllows for the PROT C command.
UseEPSVAllows extended passive mode.
UseMLSDUses listings for machine processing.
UseMLSTUses single file listing for machine processing.
UseModeZAllows compression to be used when transferring data.
UseOldAUTHSSLAllows use of the 'AUTH SSL' command instead of 'AUTH TLS'.
UseProtWhenImplicitSends the PROT P command to the server.
UseRemoteHostAddressForPassiveInstructs the component to use the address specified by RemoteHost when establishing a data connection.
VirtualHostNameSends the HOST command to the server.
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.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
NetCmdlets 2020 - Version 20.0 [Build 8319]