Skip to content

tomohulk/WinSCP

Folders and files

NameName
Last commit message
Last commit date
Jan 7, 2025
May 10, 2023
May 30, 2024
Apr 27, 2023
Jan 7, 2025
May 3, 2023
Sep 2, 2014
Mar 20, 2019
Apr 2, 2018
Aug 23, 2023
May 23, 2023

Repository files navigation

WinSCP PowerShell Module Wrapper

CI/CD

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

Example

# Capture credentials.
$credential = Get-Credential

# Set the options to open the WinSCPSession with
$sessionOption = New-WinSCPSessionOption -HostName ftp.tomohulk.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 and remove the session object.
Remove-WinSCPSession

Check back regularly for updates.

This project is licensed with GNU GENERAL PUBLIC LICENSE.