【问题标题】:Powershell, ftp, get-childitemPowershell、ftp、get-childitem
【发布时间】:2011-02-22 02:26:51
【问题描述】:

对 powershell 有点陌生。我正在尝试找到一个类似 get-childitem 的命令,该命令可以在 ftp 站点上运行。

这是一些伪代码:

$target = "c:\file.txt"
$username = "username"
$password = "password"
$ftp = "ftp://$username:$password@myftpsite"

$webclient = New-Object System.Net.WebClient 
$uri = New-Object System.Uri($ftp) 

#below is the code that does not work, get-childitem needs a local path
$name = get-childitem -path $ftp

get-childitem 仅适用于本地路径。有谁知道我在 ftp 站点上如何以这种方式访问​​文件名?

谢谢

【问题讨论】:

标签: powershell ftp get-childitem


【解决方案1】:

如果您希望 Get-ChildItem 在通过 FTP 访问的远程文件系统上工作,您需要一个 FTP PowerShell 提供程序。这个forum post 提到了 Nick Howell 在 FTP 提供商上所做的工作。除此之外,我还没有听说过任何其他 PowerShell 的 FTP 提供程序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多