对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 站点上如何以这种方式访问文件名?
谢谢