Skip to content

iokevins/WinSCP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinSCP PowerShell Module Wrapper

Build status

Use at your own risk.

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

WinSCP Cmdlets

Examples

Example 1:

# Capture credentials.
$credential = Get-Credential

# Create new WinSCP session using captured credentials.
# 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 necassary if you will have more then one session open at a time.
New-WinSCPSession -Credential $credential -HostName $env:COMPUTERNAME -Protocol Ftp

# 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

Example 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.
New-WinSCPSession -Credential (Get-Credential) -HostName $env:COMPUTERNAME -Protocol Ftp | Receive-WinSCPItem -Path './file.txt' -Destination 'C:\folder\'

This is still a beta version, with most of the functionality available with WinSCP, I intend on developing this extensively.

Check back regularly for updates.

This project is licensed with GNU GENERAL PUBLIC LICENSE.

About

WinSCP PowerShell Wrapper Module

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%