< Back

Get-SFTPContent

Sat Jan 18, 2020 7:56 pm

NAME Get-SFTPContent



SYNOPSIS

Gets the content of the item at the specified location over SFTP.





SYNTAX

Get-SFTPContent [-SessionId] <Int32[]> [-Path] <String> [[-ContentType] <String>] [-Encoding <String>]

[<CommonParameters>]



Get-SFTPContent [-SFTPSession] <SftpSession[]> [-Path] <String> [[-ContentType] <String>] [-Encoding <String>]

[<CommonParameters>]





DESCRIPTION

Gets the content of the item at the specified location over SFTP.





PARAMETERS

-SessionId <Int32[]>

SFTP Session Id of an exiting session.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Path <String>

Path to file to get content from.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ContentType <String>

How should the content be retured for the file being read. * Byte - returns a byte array.



* MultiLine - Retuns a string array where each element represents a line in the file.



* String - returns a string with all the contents of the file.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Encoding <String>

What type of encoding to use when content type is String or MultiLine.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SFTPSession <SftpSession[]>

SFTP Session Object of an exiting session.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

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.Int32[]





System.String





SSH.SftpSession[]







OUTPUTS



NOTES









-------------------------- EXAMPLE 1 --------------------------



Get-SFTPContent -SessionId 0 -Path /etc/system-release

CentOS Linux release 7.0.1406 (Core)







RELATED LINKS

Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs