< Back
Get-SCPFile
Post
NAME Get-SCPFile
SYNOPSIS
Download a File from a SSH Server using SCP
SYNTAX
Get-SCPFile [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-LocalFile <String>] [-RemoteFile
<String>] [-OperationTimeout <Int32>] [-ConnectionTimeout <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted]
[-NoProgress] [<CommonParameters>]
Get-SCPFile [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-LocalFile <String>] [-RemoteFile
<String>] [-OperationTimeout <Int32>] [-ConnectionTimeout <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted]
[-NoProgress] [-KeyFile <String>] [<CommonParameters>]
Get-SCPFile [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>] [-ProxyPort <Int32>]
[-ProxyCredential <PSCredential>] [-ProxyType <String>] [-LocalFile <String>] [-RemoteFile <String>]
[-OperationTimeout <Int32>] [-ConnectionTimeout <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted] [-NoProgress]
[-KeyString <String[]>] [<CommonParameters>]
DESCRIPTION
Download a specified file from a SSH Server using SCP given its full path and name to give it locally.
PARAMETERS
-ComputerName <String[]>
FQDN or IP Address of host to establish a SCP Session.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
SSH Credentials to use for connecting to a server. If a key file is used the password field is used for the
Key pass phrase.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Port <Int32>
SSH TCP Port number to use for the SCP connection
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyServer <String>
Proxy server name or IP Address to use for connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyPort <Int32>
Port to connect to on proxy server to route connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyCredential <PSCredential>
PowerShell Credential Object with the credentials for use to connect to proxy server if required
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyType <String>
Type of Proxy being used (HTTP, Socks4 or Socks5).
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-LocalFile <String>
Full path and file name to where to download the file on the local system.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-RemoteFile <String>
Full path to file on server that you wish to download.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OperationTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ConnectionTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AcceptKey [<SwitchParameter>]
Automatically accepts a new SSH fingerprint for a host
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Force [<SwitchParameter>]
Do not perform any host key validation of the host.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ErrorOnUntrusted [<SwitchParameter>]
Throw a terminating error if the host key is not a trusted one.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-NoProgress [<SwitchParameter>]
Dont show a progress bar during download of the file.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyFile <String>
OpenSSH format SSH private key file.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyString <String[]>
OpenSSH key in a string array to be used for authentication.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String[]
System.Management.Automation.PSCredential
System.Int32
System.String
System.Boolean
OUTPUTS
NOTES
Example 1
PS C:\\> Get-SCPFile -ComputerName 192.168.1.169 -Credential carlos -LocalFile .\\dmesg_log -RemoteFile
"/var/log/dmesg" -Verbos
Download a remote server dmesg log file and save it under a new name in the current folder.
RELATED LINKS
Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs
SYNOPSIS
Download a File from a SSH Server using SCP
SYNTAX
Get-SCPFile [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-LocalFile <String>] [-RemoteFile
<String>] [-OperationTimeout <Int32>] [-ConnectionTimeout <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted]
[-NoProgress] [<CommonParameters>]
Get-SCPFile [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-LocalFile <String>] [-RemoteFile
<String>] [-OperationTimeout <Int32>] [-ConnectionTimeout <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted]
[-NoProgress] [-KeyFile <String>] [<CommonParameters>]
Get-SCPFile [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>] [-ProxyPort <Int32>]
[-ProxyCredential <PSCredential>] [-ProxyType <String>] [-LocalFile <String>] [-RemoteFile <String>]
[-OperationTimeout <Int32>] [-ConnectionTimeout <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted] [-NoProgress]
[-KeyString <String[]>] [<CommonParameters>]
DESCRIPTION
Download a specified file from a SSH Server using SCP given its full path and name to give it locally.
PARAMETERS
-ComputerName <String[]>
FQDN or IP Address of host to establish a SCP Session.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
SSH Credentials to use for connecting to a server. If a key file is used the password field is used for the
Key pass phrase.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Port <Int32>
SSH TCP Port number to use for the SCP connection
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyServer <String>
Proxy server name or IP Address to use for connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyPort <Int32>
Port to connect to on proxy server to route connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyCredential <PSCredential>
PowerShell Credential Object with the credentials for use to connect to proxy server if required
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyType <String>
Type of Proxy being used (HTTP, Socks4 or Socks5).
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-LocalFile <String>
Full path and file name to where to download the file on the local system.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-RemoteFile <String>
Full path to file on server that you wish to download.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OperationTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ConnectionTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AcceptKey [<SwitchParameter>]
Automatically accepts a new SSH fingerprint for a host
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Force [<SwitchParameter>]
Do not perform any host key validation of the host.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ErrorOnUntrusted [<SwitchParameter>]
Throw a terminating error if the host key is not a trusted one.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-NoProgress [<SwitchParameter>]
Dont show a progress bar during download of the file.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyFile <String>
OpenSSH format SSH private key file.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyString <String[]>
OpenSSH key in a string array to be used for authentication.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String[]
System.Management.Automation.PSCredential
System.Int32
System.String
System.Boolean
OUTPUTS
NOTES
Example 1
PS C:\\> Get-SCPFile -ComputerName 192.168.1.169 -Credential carlos -LocalFile .\\dmesg_log -RemoteFile
"/var/log/dmesg" -Verbos
Download a remote server dmesg log file and save it under a new name in the current folder.
RELATED LINKS
Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs