I have been revisiting this module as of late, add making some major changes:
- New functions:
- Get-WinSCPSession
- Get-WinSCPHostKeyFingerprint
- New-WinSCPSessionOption
- New-WinSCPTransferResumeSupport
- The
New-WinSCPSession
has been split into two functions, most of the configurations for the session have been moved to theNew-WinSCPSessionOption
command. This will mimic the functionality ofNew-CimSessionOption
andNew-CimSession
.PS C:\> New-WinSCPSession -SessionOption (New-WinSCPSessionOption -HostName ftp.dotps1.github.io)
- The session is not longer auto disposed when passed in the pipeline, handling the session state is now your responsibility.
- I am completely overhauling the help, and adding more examples using platyPS.
- The
New-WinSCPSessionOption
defaults to using Anonymous authentication. - Updated pester tests.
- Re implemented AppVeyor build.
- Auto publishing to both PowerShellGallery.com and GitHub Releases.
- Lots of bug fixes.
This module can be installed from the PowerShellGet Gallery, You need WMF 5 to use this feature.
# Inspect
Save-Module -Name WinSCP -Path <Path>
# Install
Install-Module -Name WinSCP
- ConvertTo-WinSCPEscapedString
- Get-WinSCPChildItem
- Get-WinSCPItem
- Get-WinSCPFileChecksum
- Get-WinSCPSession
- Get-WinSCPSshHostKeyFingerprint
- Invoke-WinSCPCommand
- Move-WinSCPItem
- New-WinSCPItem
- New-WinSCPItemPermission
- New-WinSCPSession
- New-WinSCPSessionOption
- New-WinSCPTransferOption
- New-WinSCPTransferResumeSupport
- Receive-WinSCPItem
- Remove-WinSCPItem
- Remove-WinSCPSession
- Rename-WinSCPItem
- Send-WinSCPItem
- Start-WinSCPConsole
- Sync-WinSCPPath
- Test-WinSCPPath
Example 1:
# Capture credentials.
$credential = Get-Credential
# Set the options to open the WinSCPSession with
$sessionOption = New-WinSCPSessionOption -HostName ftp.dotps1.github.io -Protocol Ftp -Credential $credential
# Open the session using the SessionOptions object.
# New-WinSCPSession sets the PSDefaultParameterValue of the WinSCPSession parameter for all other cmdlets to this WinSCP.Session object.
# You can set it to a variable if you would like, but it is only necessary if you will have more then one session open at a time.
New-WinSCPSession -SessionOption $sessionOption
# Use that session to create a new Directory.
New-WinSCPItem -Path './remoteDirectory' -ItemType Directory
# Upload a file to the directory.
Send-WinSCPItem -Path 'C:\localDirectory\localFile.txt' -Destination '/remoteDirectory/'
# Close the session object.
Remove-WinSCPSession
Check back regularly for updates.
This project is licensed with GNU GENERAL PUBLIC LICENSE.