PowerShell Module Wrapper for use with the WinSCP.exe and WinSCPnet.dll.
The developers of the WinSCP have exposed most if not all available methods and properties of the program to .net and COM,
this is a set of PowerShell Cmdlets to sit on top of that assembly to allow for easy automation and a native PowerShell 'feel' of WinSCP with PowerShell.
# Create a PSCredenital Object to authenticate with.
$credential = Get-Credential
# Create new Session Options Object.
$session = New-WinSCPSession -HostName 'myftphost.org' -Credential $credential -Protocol Ftp
# List contents of the root directory on the server.
Get-WinSCPChildItem -WinSCPSession $session -Path '/'
# Send a file to the host.
Send-WinSCPItem -WinSCPSession $session -Path 'C:\folder\file.txt' -Destination '/file.txt'
# Receive a file from the server and remove it from the host after completion.
Receive-WinSCPItem -WinSCPSession $session -Path '/file.txt' -Destination 'C:\folder\file.txt' -Remove
# Remove the WinSCP Session object.
Remove-WinSCPSession -WinSCPSession $session
# If the WinSCP.Session Object is passed through the pipeline it will be auto-closed upon the completion of that command.
New-WinSCPSession -HostName 'myftphost.org' -Credential (Get-Credential) -Protocol Ftp | Send-WinSCPItem -Path 'C:\File.txt' -Destination '/file.txt' -Remove
WinSCP, Ftp, Sftp