Skip to content

Instantly share code, notes, and snippets.

@dalegaspi
Last active January 7, 2022 03:11
Show Gist options
  • Save dalegaspi/e007057cac607f6725f5 to your computer and use it in GitHub Desktop.
Save dalegaspi/e007057cac607f6725f5 to your computer and use it in GitHub Desktop.
FTP with PowerShell using built-in Windows FTP client
# as discussed here: http://stackoverflow.com/questions/1867385/upload-files-with-ftp-using-powershell
$server = "ftp.lolcats.com"
$filelist = "file1.txt file2.txt"
"open $server
user $user $password
binary
cd $dir
" +
($filelist.split(' ') | %{ "put ""$_""`n" }) | ftp -i -in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment