【发布时间】: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 站点上如何以这种方式访问文件名?
谢谢
【问题讨论】:
-
这里的答案可能会有所帮助stackoverflow.com/questions/265339
标签: powershell ftp get-childitem