This module can be installed from the PowerShellGet Gallery, You need WMF 5 to use this feature.
# To install WinSCP, run the following command in the PowerShell prompt in Administrator mode:
Install-Module -Name WinSCPI will no longer be supporting Chocolatey or PSGet for module repos; mainly because i feel the PowerShellGallery is working very well, and Chocolatey takes months to approve packages. I apologize for any trouble this causes.
- ConvertTo-WinSCPEscapedString
- Get-WinSCPChildItem
- Get-WinSCPItem
- Get-WinSCPFileChecksum
- Invoke-WinSCPCommand
- Move-WinSCPItem
- New-WinSCPItem
- New-WinSCPFilePermission
- New-WinSCPSession
- New-WinSCPTransferOption
- Receive-WinSCPItem
- Remove-WinSCPItem
- Remove-WinSCPSession
- Rename-WinSCPItem
- Send-WinSCPItem
- Start-WinSCPConsole
- Sync-WinSCPPath
- Test-WinSCPPath
Example 1:
# Open a new WinSCPSession using the splatted parameters.
$credential = Get-Credential
$session = New-WinSCPSession -Credential $credential -HostName $env:COMPUTERNAME -Protocol Ftp
# Use that session to create a new Directory and then upload a file to it.
New-WinSCPItem -WinSCPSession $session -Path './remoteDirectory' -ItemType Directory
Send-WinSCPItem -WinSCPSession $session -Path "C:\localDirectory\localFile.txt" -Destination "/remoteDirectory/"
# Close the session object.
Remove-WinSCPSession -WinSCPSession $sessionExample 2:
# Create session, download a file, and close the session in one line.
# If the WinSCP.Session Object is passed through the pipeline it will be auto-closed upon the completion of that command.
# To avoid this behaviour, set the WinSCP.Session object value to variable to be reused.
New-WinSCPSession -Credential (Get-Credential) -HostName $env:COMPUTERNAME -Protocol Ftp | Receive-WinSCPItem -Path "./file.txt" -Destination "C:\folder\"This is still a very beta version, with most of the functionality available with WinSCP, I intend on developing this extensively.
I have included the WinSCPnet.dll in the NeededAssemblies folder.
Check back regularly for updates.
this project is licensed with GNU GENERAL PUBLIC LICENSE.