Calculates a checksum of a remote object.
Get-WinSCPItemChecksum [-WinSCPSession] <Session> [-Algorithm] <String> [-Path] <String> [<CommonParameters>]
Use IANA Algorithm to retrieve the checksum of a remote file.
A valid open WinSCP Session, returned from New-WinSCPSession.
A name of a checksum algorithm to use. Use IANA name of algorithm or use a name of any proprietary algorithm the server supports (with SFTP protocol only). Commonly supported algorithms are sha-1 and md5.
A full path to a remote object to calculate a checksum for.
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
If the WinSCPSession is piped into this command, the connection will be closed and the object will be disposed upon completion of the command. Note that calculation of remote file checksum is supported with SFTP and FTP protocols only, subject to support of respective protocol extension.
PS C:\> New-WinSCPSession -Credential (New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $env:USERNAME, (New-Object -TypeName System.Security.SecureString)) -Hostname 'myftphost.org' -Protocol Ftp | Get-WinSCPItemChecksum -Algorithm 'sha-1' -Path '/rDir/file.txt'