问题描述
我需要编写一个脚本,将文件从一个文件夹传输到另一台服务器 (Linux),但是传输文件的脚本在 Windows 上,我想知道是否有 scp
的替代方案对于 PowerShell(或者如果有其他方法可以做到这一点)
I need to write a script that transfers files from a folder onto another server (Linux), but the script that's transferring files is on windows, and I was wondering if there was an alternative to scp
for PowerShell (or if there was another way of doing this)
推荐答案
pscp.exe
是一个可行的选择,但我一直在使用来自 Rebex 几年来,C# 应用程序和 PowerShell 脚本中的 SFTP 和 FTPS 传输取得了巨大成功.他们的包裹还包括一个SCP对象,但我没有亲自使用它.
pscp.exe
is a viable option, but I have been using a library from Rebex for a couple years now for SFTP and FTPS transfers in both C# apps and PowerShell scripts with great success. Their package also includes an SCP object but I haven't personally used it.
与 pscp
免费相比,它确实要花钱.在选择 Rebex 包之前,我曾考虑走 PuTTY 路线,但我的团队认为,从长远来看,拥有一个我们可以轻松融入任何应用程序/脚本的库是值得的.
It does cost money vs. pscp
being free. Before selecting the Rebex package, I had considered going the PuTTY route but my team decided that having a library we could easily roll into any app/script was worthwhile in the long term.
这篇关于PowerShell 是否有 SCP 替代方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!